0
Fork 0
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:
Kevin Ansfield 2018-06-20 13:20:49 +01:00
parent 984654e19e
commit a6686e9cef

View file

@ -33,6 +33,12 @@ export const DEFAULT_KEY_COMMANDS = [{
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;
}
}, {