mirror of
https://github.com/lingke-net/koring-space.git
synced 2026-09-12 05:45:17 +08:00
Forward abort signal to slash suggestions
Update the slash suggestion handler to accept an AbortSignal and pass it through to defaultSlashSuggestions. This enables cancellation of in-flight async suggestion calls (avoids race conditions and wasted work) in components/kibo-ui/editor/index.tsx.
This commit is contained in:
@@ -600,8 +600,8 @@ export const EditorProvider = ({
|
|||||||
Subscript,
|
Subscript,
|
||||||
Slash.configure({
|
Slash.configure({
|
||||||
suggestion: {
|
suggestion: {
|
||||||
items: async ({ editor, query }) => {
|
items: async ({ editor, query, signal }) => {
|
||||||
const items = await defaultSlashSuggestions({ editor, query });
|
const items = await defaultSlashSuggestions({ editor, query, signal });
|
||||||
|
|
||||||
if (!query) {
|
if (!query) {
|
||||||
return items;
|
return items;
|
||||||
|
|||||||
Reference in New Issue
Block a user