Skip to content

Commit 1ba3a92

Browse files
committed
fix(richtext-lexical): text within relationship and upload node components was not able to be selected without selection resetting immediately
1 parent 9814fd7 commit 1ba3a92

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/richtext-lexical/src/field/features/relationship/nodes/components/RelationshipComponent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ const Component: React.FC<Props> = (props) => {
121121
if (event.shiftKey) {
122122
setSelected(!isSelected)
123123
} else {
124-
clearSelection()
125-
setSelected(true)
124+
if (!isSelected) {
125+
clearSelection()
126+
setSelected(true)
127+
}
126128
}
127129
return true
128130
}

packages/richtext-lexical/src/field/features/upload/component/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ const Component: React.FC<ElementProps> = (props) => {
128128
if (event.shiftKey) {
129129
setSelected(!isSelected)
130130
} else {
131-
clearSelection()
132-
setSelected(true)
131+
if (!isSelected) {
132+
clearSelection()
133+
setSelected(true)
134+
}
133135
}
134136
return true
135137
}

0 commit comments

Comments
 (0)