[2.x] fix: iPad/touch devices require double-tap in discussion list (#4535)#4556
Draft
[2.x] fix: iPad/touch devices require double-tap in discussion list (#4535)#4556
Conversation
…uch devices On iOS and other touch devices, a plain tap on a discussion list item required a double-tap to navigate. The slidable touchend handler was always calling reset() (a jQuery animation) even when the slider hadn't moved (pos === 0). This animation interfered with the browser's synthetic click event on the underlying link, swallowing the first tap. Fix: only call reset() when pos !== 0, i.e. the content actually slid and needs animating back. A plain tap or vertical scroll (both leave pos at 0) no longer trigger the animation, allowing the synthetic click to fire normally. Closes #4535
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4535.
On iOS and other touch devices, tapping a discussion in the list required a double-tap to navigate.
The
slidableutility attachestouchendto.Slidable-contentand was unconditionally callingreset()— a jQuery animation — even when the slider hadn't moved at all (pos === 0). This animation ran on the element under the user's finger and interfered with the browser's synthetic click event, swallowing the first tap.The fix is minimal: only call
reset()whenpos !== 0, i.e. the content actually slid and needs to be animated back. Plain taps and vertical scrolls both leaveposat0and no longer trigger the animation, allowing the synthetic click to propagate normally.