mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
Add tab as a method to accept mentions autocomplete (#35933)
GitOrigin-RevId: 7cbb459294175817a63d0942f882fd29b3c813a4
This commit is contained in:
@@ -8,7 +8,11 @@ import {
|
||||
} from '@codemirror/view'
|
||||
import { Compartment } from '@codemirror/state'
|
||||
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands'
|
||||
import { autocompletion, completionStatus } from '@codemirror/autocomplete'
|
||||
import {
|
||||
acceptCompletion,
|
||||
autocompletion,
|
||||
completionStatus,
|
||||
} from '@codemirror/autocomplete'
|
||||
import classNames from 'classnames'
|
||||
import mentions, {
|
||||
mentionCompletions,
|
||||
@@ -237,6 +241,8 @@ export const MentionsInput = forwardRef<
|
||||
return true
|
||||
},
|
||||
},
|
||||
// Accept the highlighted suggestion on Tab, as in the main editor's autocomplete.
|
||||
{ key: 'Tab', run: acceptCompletion },
|
||||
...defaultKeymap,
|
||||
...historyKeymap,
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user