We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes the autocomplete overlay remains open even if the parent view is destroyed.
I managed to resolve that by adding the destroy callback in decoration.ts, but it doesn't seem like the right way to do it.
destroy
decoration.ts
destroy: () => { reducer({ kind: ActionKind.close, view: null, trigger: null, range: null, filter: null, type: null }); }, update: (view, prevState) => { const prev = plugin.getState(prevState) as ActiveAutocompleteState; const next = plugin.getState(view.state) as ActiveAutocompleteState; const started = !prev.active && next.active; const stopped = prev.active && !next.active; const changed = next.active && !started && !stopped && prev.filter !== next.filter; const action: Omit<AutocompleteAction, 'kind'> = { view, trigger: next.trigger ?? (prev.trigger as string), filter: next.filter ?? prev.filter, range: next.range ?? (prev.range as FromTo), type: next.type ?? prev.type, }; if (started) reducer({ ...action, kind: ActionKind.open }); if (changed) reducer({ ...action, kind: ActionKind.filter }); if (stopped) reducer({ ...action, kind: ActionKind.close }); }
If this does seem ok, I'll create a PR.
The text was updated successfully, but these errors were encountered:
I added this part too.
handleDOMEvents: { blur: (view) => { closeAutocomplete(view); }, },
Sorry, something went wrong.
No branches or pull requests
Sometimes the autocomplete overlay remains open even if the parent view is destroyed.
I managed to resolve that by adding the
destroy
callback indecoration.ts
, but it doesn't seem like the right way to do it.If this does seem ok, I'll create a PR.
The text was updated successfully, but these errors were encountered: