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

Refactor stopPropagation to fix #198 #202

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Conversation

malash
Copy link
Collaborator

@malash malash commented Apr 17, 2023

This PR fixed #198

Previously, GojiJS used e.target.dataset to detect whether an event had been stopped or not. However, this approach failed to work when crossing custom component such as Subtree or wrapped components. To improve stability, I have refactored the implementation of stopPropagation using the instance tree ( VDOM tree ).

When stopPropagation is called on an element, GojiJS marks itself and its ancestors as stopped, and they will no longer accept events with the same type and timeStamp. Throughout this process, we assume that events with the same typeandtimeStamp` are dispatched from the same source.

@malash malash merged commit 18b8d98 into main Apr 17, 2023
18 checks passed
@malash malash deleted the refactor-stopPropagation branch April 17, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing e.target.dataset in event handler when crossing custom component
1 participant