Skip to content

Commit

Permalink
feat: Add key bindings for uppercase letters for bold, italic and und…
Browse files Browse the repository at this point in the history
…erline (#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>
  • Loading branch information
mejo- authored Feb 3, 2022
1 parent 2fe6e21 commit b9bd469
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/extension-bold/src/bold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const Bold = Mark.create<BoldOptions>({
addKeyboardShortcuts() {
return {
'Mod-b': () => this.editor.commands.toggleBold(),
'Mod-B': () => this.editor.commands.toggleBold(),
}
},

Expand Down
1 change: 1 addition & 0 deletions packages/extension-italic/src/italic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const Italic = Mark.create<ItalicOptions>({
addKeyboardShortcuts() {
return {
'Mod-i': () => this.editor.commands.toggleItalic(),
'Mod-I': () => this.editor.commands.toggleItalic(),
}
},

Expand Down
1 change: 1 addition & 0 deletions packages/extension-underline/src/underline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const Underline = Mark.create<UnderlineOptions>({
addKeyboardShortcuts() {
return {
'Mod-u': () => this.editor.commands.toggleUnderline(),
'Mod-U': () => this.editor.commands.toggleUnderline(),
}
},
})

0 comments on commit b9bd469

Please sign in to comment.