Fix mention blot to enable native keyboard navigation

Co-authored-by: Chris Svenningsen <chris@carbonfive.com>
This commit is contained in:
Sidney Keese 2020-11-10 09:51:24 -08:00 committed by GitHub
parent a5cfebe87a
commit 5c810c65cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 24 deletions

View file

@ -400,26 +400,6 @@ export const CompositionInput: React.ComponentType<Props> = props => {
return true;
};
const onCtrlA = () => {
const quill = quillRef.current;
if (quill === undefined) {
return;
}
quill.setSelection(0, 0);
};
const onCtrlE = () => {
const quill = quillRef.current;
if (quill === undefined) {
return;
}
quill.setSelection(quill.getLength(), 0);
};
const onBackspace = () => {
const quill = quillRef.current;
@ -576,8 +556,6 @@ export const CompositionInput: React.ComponentType<Props> = props => {
handler: onShortKeyEnter,
},
onEscape: { key: 27, handler: onEscape }, // 27 = Escape
onCtrlA: { key: 65, ctrlKey: true, handler: onCtrlA }, // 65 = a
onCtrlE: { key: 69, ctrlKey: true, handler: onCtrlE }, // 69 = e
onBackspace: { key: 8, handler: onBackspace }, // 8 = Backspace
},
},