Skip to content

Commit

Permalink
fix(core): quick selection error (#275)
Browse files Browse the repository at this point in the history
An error occurs when press the ArrowUp on the keyboard on the root node
  • Loading branch information
wangzongxu authored Apr 16, 2022
1 parent ae201f5 commit ce2b6eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/shortcuts/QuickSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ export const SelectPrevNode = new Shortcut({
} else {
selection.select(previousNode)
}
} else {
} else if (selectedNode.parent) {
selection.select(selectedNode.parent)
} else {
const bottom = findBottomLastChild(selectedNode.lastChild)
if (bottom) {
selection.select(bottom)
}
}
}
}
Expand Down

0 comments on commit ce2b6eb

Please sign in to comment.