forked from fritx/vue-at
-
Couldn't load subscription status.
- Fork 1
Open
Description
In rare cases it's possible to trigger handleInput via the watch of members from a node external to the one wrapped by the At instance.
The happened in the following scenario:
- We have a rendered "mention" in a message thread
- Clicking it does several things one of which results in triggering an update to a data item which happens to also be in the
Atmemberspool. - The watch of
memberskicks in - the
rangeinhandleInputget created but itscommonAncestorContaineris the text node belonging to the link in the message thread, completely external to theAtinstance - Because the text value of the link includes
@ie. it is a display of a mention the mention detection based on the range kicks in - This results in the
Atinstance matching valid results and displaying the panel even tho no input was actually entered in the input wrapped by theAt
To resolve this issue the following logic was added
- After the range is created, recursively walk the node tree from
range.commonAncestorContainerto check it is inside of theAtinstancesthis.$elif it isn't exit the rest of thehandleInputfunction - This only occurs if
keepis true which is currently only set in the watch as thats the only time it needs to happen
fritxfritx
Metadata
Metadata
Assignees
Labels
No labels