Merge pull request #1750 from paradox460/main

Add support for Command (⌘) key shortcuts on Markdown text areas
This commit is contained in:
SleeplessOne1917 2023-07-02 11:03:10 +00:00 committed by GitHub
commit 6a62d48257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -473,7 +473,7 @@ export class MarkdownTextArea extends Component<
// Keybind handler // Keybind handler
// Keybinds inspired by github comment area // Keybinds inspired by github comment area
handleKeyBinds(i: MarkdownTextArea, event: KeyboardEvent) { handleKeyBinds(i: MarkdownTextArea, event: KeyboardEvent) {
if (event.ctrlKey) { if (event.ctrlKey || event.metaKey) {
switch (event.key) { switch (event.key) {
case "k": { case "k": {
i.handleInsertLink(i, event); i.handleInsertLink(i, event);