File tree 2 files changed +6
-0
lines changed
packages/@sanity/form-builder/src/inputs/BlockEditor-slate
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ export default class FormBuilderBlock extends React.Component {
110
110
}
111
111
112
112
handleSelectionChange = event => {
113
+ if ( ! this . _editorNode . contains ( event . target ) ) {
114
+ return
115
+ }
113
116
const selection = document . getSelection ( )
114
117
const isSelected = selection . containsNode
115
118
&& selection . containsNode ( this . formBuilderBlock )
Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ export default class FormBuilderInline extends React.Component {
87
87
}
88
88
89
89
handleSelectionChange = event => {
90
+ if ( ! this . _editorNode . contains ( event . target ) ) {
91
+ return
92
+ }
90
93
const selection = document . getSelection ( )
91
94
const isSelected = selection . containsNode
92
95
&& selection . containsNode ( this . formBuilderInline )
You can’t perform that action at this time.
0 commit comments