mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 11:50:52 +08:00
Merge fc26306b7e
into 11c8cc1e19
This commit is contained in:
commit
6830c68cbd
@ -55,7 +55,12 @@ export const EVENT_KEYS = Object.freeze(generateKeyHash([
|
||||
'ArrowLeft',
|
||||
'ArrowRight',
|
||||
'Tab',
|
||||
'Escape'
|
||||
'Escape',
|
||||
'Control',
|
||||
'Alt',
|
||||
'Shift',
|
||||
'PageUp',
|
||||
'PageDown'
|
||||
]))
|
||||
|
||||
export const LOWERCASE_TAGS = Object.freeze(generateKeyHash([
|
||||
|
@ -68,6 +68,10 @@ class Keyboard {
|
||||
) {
|
||||
return
|
||||
}
|
||||
if (event.key === EVENT_KEYS.Control || event.key === EVENT_KEYS.Alt || event.key === EVENT_KEYS.Escape || event.key === EVENT_KEYS.Shift || event.key === EVENT_KEYS.PageUp || event.key === EVENT_KEYS.PageDown) { // we don't want to focus on the cursor if the user just hits one of these keys. Other editors do not.
|
||||
return
|
||||
}
|
||||
|
||||
// Cursor outside editor area or over not editable elements.
|
||||
if (event.target.closest('[contenteditable=false]')) {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user