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
In pat-sortable we currently have some detection items which are added. This is done via the pat-update JavaScript event and via another event thrown by pat-inject. This covers all core-Patternslib use cases.
But this method for detecting new additions has some problems:
It's bound to Patternslib internals. It doesn't work if items are added from outside. We currently have a use-case in Mockup, where a svelte application is adding items to a container and these items should be sortable. We could also throw one of the events mentioned above, but this again make use of Patternslib internals and is not a generic solution which would work in any case.
There is currently no re-initialization on item removal.
These problems can be fixed by making use of MutationObservers which would filter for added or removed items matching the selector. We could further filter for only direct descendants of the Pattern element itself as we are doing it with the current implementation of pat-sortable.
The text was updated successfully, but these errors were encountered:
In
pat-sortable
we currently have some detection items which are added. This is done via thepat-update
JavaScript event and via another event thrown bypat-inject
. This covers all core-Patternslib use cases.But this method for detecting new additions has some problems:
These problems can be fixed by making use of
MutationObservers
which would filter for added or removed items matching the selector. We could further filter for only direct descendants of the Pattern element itself as we are doing it with the current implementation ofpat-sortable
.The text was updated successfully, but these errors were encountered: