Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ontouchstart handler for checkbox. #1693

Merged
merged 1 commit into from
Sep 12, 2017
Merged

Add ontouchstart handler for checkbox. #1693

merged 1 commit into from
Sep 12, 2017

Conversation

patleeman
Copy link
Contributor

This commit adds a ontouchstart handler to the checkbox format to allow checking and unchecking on a mobile device while focused on editor.

Based on comment by @sferoze on this issue.

This commit adds a ontouchstart handler to the checkbox format to allow checking and unchecking on a mobile device while focused on editor.
@jhchen jhchen merged commit 4c35cc6 into slab:develop Sep 12, 2017
@jhchen
Copy link
Member

jhchen commented Sep 12, 2017

Thanks!

@sferoze
Copy link
Contributor

sferoze commented Sep 16, 2017

@jhchen @patleeman

There is a mistake in this commit.

On mobile devices register both click and touch start events. So if the editor is not focused, and you check a box, it checks and then unchecks as both event handlers are called.

You only want to add one or the other.

Add touchstart handler if ('ontouchstart' in window)

otherwise, add the normal click event.

@jhchen
Copy link
Member

jhchen commented Sep 21, 2017

Good catch @sferoze! I did not notice the unfocused case when merging. Can you submit a PR?

@sferoze
Copy link
Contributor

sferoze commented Sep 21, 2017

@jhchen I just submitted a pull request with this specific fix

sferoze wants to merge 1 commit into quilljs:develop from sferoze:quill-checkbox-touchstart-fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants