mirror of
https://github.com/heyman/heynote.git
synced 2025-06-28 13:31:38 +02:00
Fix issue when pressing Ctrl/Cmd+A
in a text input inside a modal dialog
This commit is contained in:
parent
fa83c50f44
commit
15df9e5e5c
@ -5,6 +5,7 @@ Here are the most notable changes in each release. For a more detailed list of c
|
|||||||
## 2.1.4 (not released yet)
|
## 2.1.4 (not released yet)
|
||||||
|
|
||||||
- Fix issue with positioning and size of todo list checkboxes in Markdown blocks when using a non-default font size, or a non-monospaced font.
|
- Fix issue with positioning and size of todo list checkboxes in Markdown blocks when using a non-default font size, or a non-monospaced font.
|
||||||
|
- Fix issue when pressing `Ctrl/Cmd+A` in a text input inside a modal dialog (e.g. the buffer selector). Previously the select all command would be sent to the editor.
|
||||||
|
|
||||||
## 2.1.3
|
## 2.1.3
|
||||||
|
|
||||||
|
@ -85,11 +85,14 @@
|
|||||||
"showCreateBuffer",
|
"showCreateBuffer",
|
||||||
"showEditBuffer",
|
"showEditBuffer",
|
||||||
"showMoveToBufferSelector",
|
"showMoveToBufferSelector",
|
||||||
"openMoveToBufferSelector",
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
dialogVisible() {
|
||||||
|
return this.showLanguageSelector || this.showBufferSelector || this.showCreateBuffer || this.showEditBuffer || this.showMoveToBufferSelector
|
||||||
|
},
|
||||||
|
|
||||||
editorInert() {
|
editorInert() {
|
||||||
return this.showCreateBuffer || this.showSettings || this.showEditBuffer
|
return this.dialogVisible
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -133,6 +133,12 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// support Ctrl/Cmd+A to select all
|
||||||
|
if (event.key === "a" && event[window.heynote.platform.isMac ? "metaKey" : "ctrlKey"]) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.srcElement.select()
|
||||||
|
}
|
||||||
|
|
||||||
if (this.filteredItems.length === 0) {
|
if (this.filteredItems.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onInputKeydown(event) {
|
onInputKeydown(event) {
|
||||||
|
// support Ctrl/Cmd+A to select all
|
||||||
|
if (event.key === "a" && event[window.heynote.platform.isMac ? "metaKey" : "ctrlKey"]) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.srcElement.select()
|
||||||
|
}
|
||||||
|
|
||||||
// redirect arrow keys and page up/down to folder selector
|
// redirect arrow keys and page up/down to folder selector
|
||||||
const redirectKeys = ["ArrowDown", "ArrowUp", "PageDown", "PageUp"]
|
const redirectKeys = ["ArrowDown", "ArrowUp", "PageDown", "PageUp"]
|
||||||
if (redirectKeys.includes(event.key)) {
|
if (redirectKeys.includes(event.key)) {
|
||||||
|
@ -50,6 +50,12 @@
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onKeydown(event) {
|
onKeydown(event) {
|
||||||
|
// support Ctrl/Cmd+A to select all
|
||||||
|
if (event.key === "a" && event[window.heynote.platform.isMac ? "metaKey" : "ctrlKey"]) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.srcElement.select()
|
||||||
|
}
|
||||||
|
|
||||||
if (event.key === "ArrowDown") {
|
if (event.key === "ArrowDown") {
|
||||||
this.selected = Math.min(this.selected + 1, this.filteredItems.length - 1)
|
this.selected = Math.min(this.selected + 1, this.filteredItems.length - 1)
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
@ -128,6 +128,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onInputKeydown(event) {
|
onInputKeydown(event) {
|
||||||
|
// support Ctrl/Cmd+A to select all
|
||||||
|
if (event.key === "a" && event[window.heynote.platform.isMac ? "metaKey" : "ctrlKey"]) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.srcElement.select()
|
||||||
|
}
|
||||||
|
|
||||||
// redirect arrow keys and page up/down to folder selector
|
// redirect arrow keys and page up/down to folder selector
|
||||||
const redirectKeys = ["ArrowDown", "ArrowUp", "PageDown", "PageUp"]
|
const redirectKeys = ["ArrowDown", "ArrowUp", "PageDown", "PageUp"]
|
||||||
if (redirectKeys.includes(event.key)) {
|
if (redirectKeys.includes(event.key)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user