-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(list, sortable-list, value-list): Emit calciteListOrderChange whe…
…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
- Loading branch information
Showing
6 changed files
with
108 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.