mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
feat: Add key bindings for uppercase letters for bold, italic and underline (#2478)
This way, key bindings 'Mod-B', 'Mod-I' and 'Mod-U' with active caps lock have the same effect as their lowercase siblings. Prosemirror examples did the same, see ProseMirror/prosemirror#895 Fixes: #2426 Signed-off-by: Jonas <jonas@freesources.org>
This commit is contained in:
parent
2fe6e2135d
commit
b9bd469645
@ -79,6 +79,7 @@ export const Bold = Mark.create<BoldOptions>({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-b': () => this.editor.commands.toggleBold(),
|
||||
'Mod-B': () => this.editor.commands.toggleBold(),
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -78,6 +78,7 @@ export const Italic = Mark.create<ItalicOptions>({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-i': () => this.editor.commands.toggleItalic(),
|
||||
'Mod-I': () => this.editor.commands.toggleItalic(),
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -66,6 +66,7 @@ export const Underline = Mark.create<UnderlineOptions>({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-u': () => this.editor.commands.toggleUnderline(),
|
||||
'Mod-U': () => this.editor.commands.toggleUnderline(),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user