mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
[lexical-rich-text] Bug Fix: Fix right and up arrow key navigation with decorator nodes (#7393)
Co-authored-by: Bob Ippolito <bob@redivi.com>
This commit is contained in:
@ -747,10 +747,7 @@ export function registerRichText(editor: LexicalEditor): () => void {
|
||||
KEY_ARROW_UP_COMMAND,
|
||||
(event) => {
|
||||
const selection = $getSelection();
|
||||
if (
|
||||
$isNodeSelection(selection) &&
|
||||
!$isTargetWithinDecorator(event.target as HTMLElement)
|
||||
) {
|
||||
if ($isNodeSelection(selection)) {
|
||||
// If selection is on a node, let's try and move selection
|
||||
// back to being a range selection.
|
||||
const nodes = selection.getNodes();
|
||||
@ -839,10 +836,7 @@ export function registerRichText(editor: LexicalEditor): () => void {
|
||||
KEY_ARROW_RIGHT_COMMAND,
|
||||
(event) => {
|
||||
const selection = $getSelection();
|
||||
if (
|
||||
$isNodeSelection(selection) &&
|
||||
!$isTargetWithinDecorator(event.target as HTMLElement)
|
||||
) {
|
||||
if ($isNodeSelection(selection)) {
|
||||
// If selection is on a node, let's try and move selection
|
||||
// back to being a range selection.
|
||||
const nodes = selection.getNodes();
|
||||
|
Reference in New Issue
Block a user