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
=> This will not trigger the rowClicked action, which is the expected behaviour here since there is this code which will not propagate / bubble up the event.
Expected behavior
Click event insidesortable-item should not be triggered when dropping it. We previously used ember-drag-drop which had this behaviour built in.
Other info
"ember-sortable": "2.2.1"
"ember-cli": "3.20.0"
Chrome Version 87.0.4280.141 on MacOS
(Using Ember Octane, Glimmer components & ember-sortable modifier)
The text was updated successfully, but these errors were encountered:
I can take a look, but just 2 things from my side:
From a purely performance standpoint, it seems like using event delegation here would be more ideal, e.g attach click listener on the ol and attach an identifier (e.g data-*) on each row.
if you were to use a handle, it should solve this problem and perhaps provide a better a11y experience as well.
Additionally, I wonder if we should implement improved documentation and guidance? It seems like OP should refactor a bit instead of adjusting the addon behavior. WDYT?
Describe the bug
Click event inside a
sortable-item
is triggered on drop.To Reproduce
=> This will not trigger the
rowClicked
action, which is the expected behaviour here since there is this code which will not propagate / bubble up the event.=> This will trigger the
rowClicked
action, which I don't want to happen. Is this a known / expected behaviour ? Do you have any fix / workaround ?My workaround is to assert parent's class
is-dropping
in the click event like this:Expected behavior
Click event inside
sortable-item
should not be triggered when dropping it. We previously used ember-drag-drop which had this behaviour built in.Other info
Ember Octane
,Glimmer components
&ember-sortable modifier
)The text was updated successfully, but these errors were encountered: