mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Koenig - Fix card selection after exiting blank container card
refs https://github.com/TryGhost/Ghost/issues/9623 - it's necessary to pass a cursor movement to `deleteCard` for card selection after the delete to work - default to `CURSOR_AFTER` as it's the more typical direction compared to `NO_CURSOR_MOVEMENT`
This commit is contained in:
parent
f9a1342d01
commit
7df4817447
2 changed files with 3 additions and 3 deletions
|
@ -471,7 +471,7 @@ export default Component.extend({
|
|||
this.set('linkRange', null);
|
||||
},
|
||||
|
||||
deleteCard(card, cursorMovement = NO_CURSOR_MOVEMENT) {
|
||||
deleteCard(card, cursorMovement = CURSOR_AFTER) {
|
||||
this.deleteCard(card, cursorMovement);
|
||||
},
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ export const DEFAULT_KEY_COMMANDS = [{
|
|||
// feels more natural
|
||||
if (isCollapsed && offset === 0 && section.prev && section.prev.type === 'card-section' && !section.isBlank) {
|
||||
let card = koenig.getCardFromSection(section.prev);
|
||||
koenig.deleteCard(card, CURSOR_AFTER);
|
||||
koenig.deleteCard(card);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ export const DEFAULT_KEY_COMMANDS = [{
|
|||
let selectNextCard = section.next.type === 'card-section';
|
||||
let nextCard = koenig.getCardFromSection(section.next);
|
||||
|
||||
koenig.deleteCard(koenig.selectedCard, CURSOR_AFTER);
|
||||
koenig.deleteCard(koenig.selectedCard);
|
||||
|
||||
if (selectNextCard) {
|
||||
koenig.selectCard(nextCard);
|
||||
|
|
Loading…
Add table
Reference in a new issue