Change touchstart event listeners to click #57 #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).