Repository navigation
fix(hover-activate): ignore pointer events of destroyed elements - #7691
Open
Arthur031221 wants to merge 1 commit into
Open
Arthur031221 wants to merge 1 commit into
Arthur031221 wants to merge 1 commit into
Conversation
Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7588. After
graph.clear()while the pointer was over an element, every later pointer move threwUnknown element type of id, and hover stopped working on the graph, including for nodes added afterwards.clear()destroys the elements without marking them. The next pointer move makes the behavior controller emitpointerleavefor the stored target, which is now destroyed.hover-activateonly skipped elements marked as to be destroyed, so it asked for the state of an id that no longer exists and threw. The throw also happened before the controller moved on to the new target.hover-activatenow also ignores events whose target is destroyed.pointerleaveis still emitted, so other listeners are unaffected.Added a test in
hover-activate.spec.tsthat hovers a node, clears the graph and moves the pointer. Run withnpx jest __tests__/unit/behaviors/hover-activate.spec.tsinpackages/g6.Assisted by Claude/Codex.