mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
🐛 Koenig - Fixed Firefox cursor getting stuck on cards when pressing Up
refs https://github.com/TryGhost/Ghost/issues/9724 - Firefox has a bug that prevents the cursor from moving from one element to another when pressing <kbd>Up</kbd> in certain circumstances - added workaround that replicates the default behaviour that all other browsers have so that <kbd>Up</kbd> can always move to the previous section
This commit is contained in:
parent
fb6bf6b97d
commit
fc16a8f333
@ -254,6 +254,16 @@ export const DEFAULT_KEY_COMMANDS = [{
|
||||
|
||||
if (isCollapsed && (offset === 0 || section.isCardSection) && !prevSection) {
|
||||
koenig.send('exitCursorAtTop');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Firefox has a bug with cursor movement where it will stop the cursor
|
||||
// from moving upwards when a card is selected. Default behaviour in
|
||||
// all other browsers is to place the cursor at the end of the previous
|
||||
// section so we replicate that here
|
||||
if (section.isCardSection && prevSection) {
|
||||
koenig.moveCaretToTailOfSection(prevSection, false);
|
||||
return;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user