Patternslib / Patterns

Library for quickly applying rich interaction patterns without the need to write any JavaScript.
http://patternslib.com
Other
103 stars 43 forks source link

pat-sortable: Improve detection added/removed items #1197

Open thet opened 3 months ago

thet commented 3 months ago

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:

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.