fix(dia.HighlighterView): prevent highlighting nodes outside cell view #2900
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.
Description
When a highlighter is used with an
SVGElement
as its NodeSelector, and that element is not part of theCellView
, the node will not be highlighted. Instead, acell:highlighter:invalid
event is triggered—similar to what happens with a non-existent selector.Motivation and Context
When a port is highlighted using an
SVGElement
selector and its attributes are updated, we need to make the highlighter invalid. This is because ports are re-rendered on each update, and the originalSVGElement
is removed from the DOM. The problem manifest during link reconnection, when the use set port attributes onlink:connect
event.Note: This issue does not occur when using a JSON-based selector.