You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportclassAutocompleteNodeextendsDecoratorNode<JSX.Element|null>{// TODO add comment__uuid: string;staticclone(node: AutocompleteNode): AutocompleteNode{returnnewAutocompleteNode(node.__key);}constructor(uuid: string,key?: NodeKey){super(key);this.__uuid=uuid;}
should be changed to
export class AutocompleteNode extends DecoratorNode<JSX.Element | null> {
// TODO add comment
__uuid: string;
static clone(node: AutocompleteNode): AutocompleteNode {
- return new AutocompleteNode(node.__key);+ return new AutocompleteNode(node.__uuid);
}
constructor(uuid: string, key?: NodeKey) {
super(key);
this.__uuid = uuid;
}
Lexical version: 11.1
The current behavior
Currently upon cloning, the uuid will change (see that the node key is used instead).
The UUID is meant to prevent multiple autocomplete options in the same view, but if the uuid can change, this functionality doesn't work. I noticed this when creating a modified autocomplete plugin based off this one. After changing selection, there could be several nodes working independently trying to update the editor concurrently.
The expected behavior
The UUID should be stable across all instances of the plugin and all nodes tracked by the plugin. This way the autocomplete node transform can clean up old ones.
Questions
Should I ping the original author? I may be misunderstanding the intended behavior here
The text was updated successfully, but these errors were encountered:
On this line, it seems that
should be changed to
Lexical version: 11.1
The current behavior
Currently upon cloning, the uuid will change (see that the node key is used instead).
The UUID is meant to prevent multiple autocomplete options in the same view, but if the uuid can change, this functionality doesn't work. I noticed this when creating a modified autocomplete plugin based off this one. After changing selection, there could be several nodes working independently trying to update the editor concurrently.
The expected behavior
The UUID should be stable across all instances of the plugin and all nodes tracked by the plugin. This way the autocomplete node transform can clean up old ones.
Questions
Should I ping the original author? I may be misunderstanding the intended behavior here
The text was updated successfully, but these errors were encountered: