Skip to content
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

Fix merge fragments #711

Merged
merged 13 commits into from
Feb 28, 2025
Merged

Fix merge fragments #711

merged 13 commits into from
Feb 28, 2025

Conversation

bencroker
Copy link
Collaborator

@bencroker bencroker commented Feb 26, 2025

This PR fixes #709 in which data-signals was being reapplied each time any attribute changed on an element, caused by the fact that it doesn’t return a cleanup function so a hash was never created for it – a real headfuck to debug.

The fix includes storing an empty cleanup function for plugins that don’t return one. It also rehashes the cleanup functions for each element being merged to ensure that plugins are cleaned up and reapplied after merging.

I’ve also restored the assigning of unique element IDs to fragments being merged, to allow focus to be restored to focusable elements, which fixes #710.

@delaneyj note that I changed the removals key from an element to an element ID to allow for rehashing in the mergeFragments plugin.

@kaldyr
Copy link

kaldyr commented Feb 27, 2025

Fixes #709

@bencroker bencroker merged commit e40db72 into develop Feb 28, 2025
1 check passed
@bencroker bencroker deleted the fix/merge-fragments branch February 28, 2025 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants