-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List: Expose Events for dragging between Lists #7046
Comments
@driskull Would you have any update on this? |
@Csmith246 With Will update the request to |
With the Updated Codepen to Recording showing events are registered, unless a |
@geospatialem we've got a requirement for supporting accessible keyboard dragging between lists, as well. Could we add that to this issue? Or would it be better to make a new enhancement request for that? |
Great question, @Csmith246! For tracking could you create a new enhancement request? It seems like a good enhancement to separate out from the events. |
We're using the // Called by any change to the list (add / update / remove)
onSort: function (/**Event*/evt) {
// same properties as onEnd
}, We'll need to investigate why its not emitting correctly. My guess is that its something we're doing to fix VDOM errors. Bumped this issue to estimate-5. cc @geospatialem |
I think we can mark this one as a bug as well. |
…n dragging between lists (#7614) **Related Issue:** #7046 ## Summary TLDR: Basically, we need to pause draggable component connected/disconnected lifecycle events while a component is being dragged. Having these lifecycle methods kick off during a drag causes SortableJS errors. - SortableComponent - Refactors logic to prevent any SortableJS component from doing its lifecycle logic when a component is being dragged - Previously, it was preventing all SortableJS components Sortable from being destroyed or created but that was causing issues by not emitting events when an item was moved from one list to another. - The nested component check that was previously being used isn't ideal because two different lists don't have to be nested to drag items between each other. - We need all lists to still continue emitting events when necessary, we just don't want their lifecycle methods to kick off when an item is being dragged. Otherwise, JS errors are thrown. - Components - Updates SortableComponent components to not do any lifecycle callbacks when an item is being dragged to prevent any JS errors that SortableJS was throwing. - This was because in connectedCallback, sortable components were setting up the sortable instance, connecting the observer, modifying items, etc. We don't want the component to do this while an item is being dragged. - The same thing as above was happening on disconnectedCallback. - This fix stops all those errors that occurred while dragging an item from one list to another. ## Assumptions It is reasonable to not do any lifecycle events for any draggable component while a component is being dragged
Installed and assigned for verification. |
Verified in |
Big thank you from Instant Apps! 🙏 |
Actual Behavior
For the Calcite List component, when you set
dragEnabled
totrue
, and thegroup
value of more than two lists to the same key, and then move items between the lists, none of the current Event's on the List get triggered. This makes it difficult to react to drags between lists.Expected Behavior
When a List Item gets dragged from one List to a different List, maybe trigger events such as
calciteListDragOut
andcalciteListDragIn
on the respective lists. This would broadcast what specifically has occurred within the lists, and allow the wider application to perform any behaviors that are tied to a move between lists.Reproduction Sample
https://codepen.io/csmith55/pen/YzJMzYg?editors=1001https://codepen.io/geospatialem/pen/OJaGeVN
Reproduction Steps
Notice in the sample that:
group
valueIf you drag any list items from list 2 or 3 into list 1, no events are fired. If you drag any out of List 1, still no events are fired.
Reproduction Version
https://www.npmjs.com/package/@esri/calcite-components/v/1.4.1-next.41.5.1
Relevant Info
No response
Regression?
No response
Priority impact
p2 - want for current milestone
Impact
Technically, I don't believe this behavior has ever worked, but we got around that in our application by finding a reference to the internal SortableJS object and adding
onAdd
andonRemove
methods. This fix on the Calcite side (b4bbdf3) caused our work around not to work anymore, so an official solution is now desirable. Thanks!Esri team
ArcGIS Instant Apps
The text was updated successfully, but these errors were encountered: