At panel can open with results triggered externally from the node it is wrapping #142
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.
In rare cases it's possible to trigger
handleInputvia the watch ofmembersfrom a node external to the one wrapped by theAtinstance.The happened in the following scenario:
Atmemberspool.memberskicks inrangeinhandleInputget created but itscommonAncestorContaineris the text node belonging to the link in the message thread, completely external to theAtinstance@ie. it is a display of a mention the mention detection based on the range kicks inAtinstance matching valid results and displaying the panel even tho no input was actually entered in the input wrapped by theAtTo resolve this issue the following logic was added
range.commonAncestorContainerto check it is inside of theAtinstancesthis.$elif it isn't exit the rest of thehandleInputfunctionkeepis true which is currently only set in the watch as thats the only time it needs to happenIn theory this could happen at any time an update to members occurs and the range gets creating from a node external to the one the instance is wrapping and happens to have a sting containing a mention like pattern.