File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -262,18 +262,16 @@ export const LibroRender = forwardRef<HTMLDivElement>(function LibroRender(props
262262 if ( typeof ref === 'function' ) {
263263 return ;
264264 }
265- // focus编辑器host
266- if ( ! e . relatedTarget ) {
267- return ;
268- }
269- // focus编辑器外部区域
270- if ( ref ?. current ?. contains ( e . relatedTarget ) ) {
265+ const target = e . relatedTarget as Node | null ;
266+ const inside = target ? ref ?. current ?. contains ( target ) : false ;
267+
268+ if ( inside ) {
271269 const dndDom = ref ?. current ?. getElementsByClassName (
272270 'libro-dnd-cells-container' ,
273271 ) [ 0 ] ;
274272
275273 if (
276- ! dndDom ?. contains ( e . relatedTarget ) &&
274+ ! dndDom ?. contains ( target as Node ) &&
277275 ( ! instance . model . inputEditable ||
278276 ! instance . model . outputEditable ||
279277 ! instance . model . cellsEditable ) &&
You can’t perform that action at this time.
0 commit comments