mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Koenig - Ensure Enter
behaviour is consistent when a card is selected
refs https://github.com/TryGhost/Ghost/issues/9623 - clicking a card a second time while it is selected can move the invisible cursor to the beginning of a section in which case <kbd>Enter</kbd> would insert a blank paragraph above the card - when <kbd>Enter</kbd> is pressed and a card is selected, move the cursor to the end of the card section without triggering our cursor change so that the default behaviour will always add a paragraph after the card
This commit is contained in:
parent
984654e19e
commit
a6686e9cef
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ export const DEFAULT_KEY_COMMANDS = [{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if a card is selected, move the cursor to the end of the card so that
|
||||||
|
// Enter consistently adds a new paragraph after the card
|
||||||
|
if (isCollapsed && section.isCardSection) {
|
||||||
|
koenig.moveCaretToTailOfSection(section, true);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|
Loading…
Add table
Reference in a new issue