diff --git a/.changeset/tasty-maps-wave.md b/.changeset/tasty-maps-wave.md new file mode 100644 index 000000000..e3918e1c7 --- /dev/null +++ b/.changeset/tasty-maps-wave.md @@ -0,0 +1,5 @@ +--- +'@keystatic/core': patch +--- + +Fix `/` menu in `fields.markdoc`/`fields.mdx` diff --git a/packages/keystatic/src/form/fields/markdoc/editor/autocomplete/EditorListbox.tsx b/packages/keystatic/src/form/fields/markdoc/editor/autocomplete/EditorListbox.tsx index 347be6aa5..ec51a673e 100644 --- a/packages/keystatic/src/form/fields/markdoc/editor/autocomplete/EditorListbox.tsx +++ b/packages/keystatic/src/form/fields/markdoc/editor/autocomplete/EditorListbox.tsx @@ -44,6 +44,7 @@ export function useEditorListbox( let { listenerRef, onEscape, scrollRef, ...otherProps } = props; let state = useListState(props); let layout = useListBoxLayout(); + let listboxRef = useRef(null); let delegate = useMemo( () => new ListKeyboardDelegate({ @@ -55,7 +56,6 @@ export function useEditorListbox( ); // keyboard and selection management - let listboxRef = useRef(null); let { collectionProps } = useSelectableCollection({ keyboardDelegate: delegate, ref: listenerRef,