Skip to content

Commit 921c442

Browse files
feat(editor): include onSelect and onKeyDownRef for mention component (#1976)
Co-authored-by: Tofik Hasanov <annexcies@gmail.com>
1 parent c4eba59 commit 921c442

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • packages/ui/src/components/editor/extensions

packages/ui/src/components/editor/extensions/mention.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,12 @@ export function createMentionExtension({ suggestion }: CreateMentionExtensionOpt
258258
// Ensure items is always an array
259259
const items = Array.isArray(props.items) ? props.items : [];
260260

261+
// Include onSelect and onKeyDownRef to preserve keyboard navigation
261262
component.updateProps({
262263
...props,
263264
items,
265+
onSelect: suggestion.onSelect,
266+
onKeyDownRef: keyDownHandlerRef,
264267
});
265268

266269
if (!props.clientRect) {

0 commit comments

Comments
 (0)