LearnNewsExamplesServices
Frontmatter
id2431
titleplugin.Resizable: support for very fast drag OPs
stateClosed
labels
enhancement
assigneestobiu
createdAtJun 21, 2021, 12:14 PM
updatedAtJun 21, 2021, 4:03 PM
githubUrlhttps://github.com/neomjs/neo/issues/2431
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 21, 2021, 12:14 PM

plugin.Resizable: support for very fast drag OPs

Closed v8.1.0 enhancement
tobiu
tobiu commented on Jun 21, 2021, 12:14 PM

This one took me quite a while to debug.

If you mouseDown on a resize handle inside calendar.view.week.Component and then move the cursor very fast and mouseUp, a drag OP will break.

The reason is that a drag OP will not start immediately => you need to move the cursor a bit.

If the mouse cursor is already outside of the resize handle dom node at this point, the plugin will remove the node from the dom.

Now, if we mouseUp, the mouse sensor will trigger the drag:end event on a node which still exists, but is no longer inside the DOM tree. The result is that the custom DOM event will no longer get received by the main thread addon => not by calendar.view.week.EventDragZone either.

To fix this, plugin.Resizable does need a mousedown and a mouseup dom event listener, which sets isDragging to true / false.

A mousedown event will then prevent the resize handle from getting removed.

If we trigger a mouseup event on the resize handle without starting a drag OP, the logic will be back in place => leaving the node via mousemove will remove the handle.

If we trigger mouseup outside of the resize handle node, the event won't get received, but then we do have started a drag OP and the drag:end logic will set isDragging to false anyway.

So, we are good in all cases.

tobiu added the enhancement label on Jun 21, 2021, 12:14 PM
tobiu assigned to @tobiu on Jun 21, 2021, 12:14 PM
tobiu referenced in commit 47b880b - "plugin.Resizable: support for very fast drag OPs #2431" on Jun 21, 2021, 12:14 PM
tobiu closed this issue on Jun 21, 2021, 12:14 PM
keckeroo
keckeroo Jun 21, 2021, 4:03 PM

👏