You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure to test in Chrome or Edge. (For reasons I don't understand, the bug does not occur in Firefox.)
Drag the lowest item ("eight") QUICKLY downward and release it.
Click the "Click Me" button. Nothing will happen. (This is the bug.)
Click the "Click Me" button again. This time, clicking the button will trigger an alert as it should.
Describe the bug
Your fix for Issue 1184 has an unintended consequence. In Line 1138, you add an event listener to the document that stops propagation on any click event if the variable "ignoreNextClick" holds the value "true."
In theory, the "ignoreNextClick" variable will get set to "false" the first time the _onDragStart event fires. However, it's possible for this event NEVER TO FIRE if the user drags a sortable item quickly out of the sortable area and releases it. In that case, the event listener is still attached to the document, and the first time the user clicks anything in the DOM, it won't respond.
It took me a couple of hours to figure out that it was Sortable JS causing this problem and not something else in my code. I hope you can spare other developers this pain!
Expected behavior
When I click a button (or anything else) in the DOM after performing a drag-and-drop, it should behave normally. I shouldn't have to click it twice thanks to the "ignoreNextClick" event listener getting left attached to the document. (Remember, this only happens in the circumstances described above, and when "forceFallback" is set to "true.")
Version
package
version
sortablejs
^1.10.2-?
@types/sortablejs
^x.x.x-? || N/A
Additional Context
Let me know if anything isn't clear!
Dan
The text was updated successfully, but these errors were encountered:
A related issue: the disableNextClick value persists after a destroy() call, and the associated click listener can still intercept and cancel click events.
PLEASE READ THE CONTRIBUTION GUIDELINES HERE!
Failure to comply may have your issue automatically closed.
Reproduction
Scenario
https://codesandbox.io/s/green-water-dq651?file=/src/index.js
Steps to Reproduce
Summary of steps if applicable.
Make sure to test in Chrome or Edge. (For reasons I don't understand, the bug does not occur in Firefox.)
Drag the lowest item ("eight") QUICKLY downward and release it.
Click the "Click Me" button. Nothing will happen. (This is the bug.)
Click the "Click Me" button again. This time, clicking the button will trigger an alert as it should.
Describe the bug
Your fix for Issue 1184 has an unintended consequence. In Line 1138, you add an event listener to the document that stops propagation on any click event if the variable "ignoreNextClick" holds the value "true."
In theory, the "ignoreNextClick" variable will get set to "false" the first time the _onDragStart event fires. However, it's possible for this event NEVER TO FIRE if the user drags a sortable item quickly out of the sortable area and releases it. In that case, the event listener is still attached to the document, and the first time the user clicks anything in the DOM, it won't respond.
It took me a couple of hours to figure out that it was Sortable JS causing this problem and not something else in my code. I hope you can spare other developers this pain!
Expected behavior
When I click a button (or anything else) in the DOM after performing a drag-and-drop, it should behave normally. I shouldn't have to click it twice thanks to the "ignoreNextClick" event listener getting left attached to the document. (Remember, this only happens in the circumstances described above, and when "forceFallback" is set to "true.")
Version
sortablejs
^1.10.2-?
@types/sortablejs
^x.x.x-?
|| N/AAdditional Context
Let me know if anything isn't clear!
The text was updated successfully, but these errors were encountered: