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

Change touchstart event listeners to click #57 #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hashkar123
Copy link

Fix for issue #57 Clicking "sort by" dropdown while over subreddit "following" button clicks both buttons #57

The problem was that right after you select a sort_type or time_type, the 'Follow' (or 'Following') button gets clicked since the .dialog element disappears immediately after touching it (they had touchstart event listener). The .stop (for stopping propagation) doesn't help in the case. I think because the 'Follow' button has a different event listener (click). That's because I have tried changing the 'Follow' button's listener to touchstart, and it worked! But I decided not to use this solution because it becomes very easy to click accidentally when starting to scroll.

The solution that I applied is changing the touchstart event listeners to click event listners for the .dialog element and it's clickable children. I changed all of them because triggering e.g. a sort_type click event, instantly triggers it's parent's touchstart event. That is because, if I understood correctly, click events don't stop propagation
of touchstart (only click events).

Fix for issue kaangiray26#57 [Clicking "sort by" dropdown while over subreddit
"following" button clicks both buttons kaangiray26#57
](kaangiray26#57)

The problem was that right after you select a sort_type or time_type,
the 'Follow' (or 'Following') button gets clicked since the .dialog
element disappears immediately after touching it (they had touchstart
event listener). The .stop (for stopping propagation) doesn't help
in the case. I think because the 'Follow' button has a different event
listener (click). That's because I have tried changing the 'Follow'
button's listener to touchstart, and it worked! But I decided not to
use this solution because it becomes very easy to click accidentally
when starting to scroll.

The solution that I applied is changing the touchstart event listeners
to click event listners for the .dialog element and it's clickable
children. I changed all of them because triggering e.g. a sort_type
click event, instantly triggers it's parent's touchstart event. That is
because, if I understood correctly, click events don't stop propagation
 of touchstart (only click events).
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.

1 participant