File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -303,14 +303,18 @@ class LiveTranslatorManager {
303
303
position . top = clientRect . top + window . scrollY ;
304
304
position . left = clientRect . left + window . screenX ;
305
305
const elemOnTop = document . elementFromPoint ( clientRect . left + clientRect . width / 2 , clientRect . top + clientRect . height / 2 ) ;
306
- isVisible = isVisible || node . parentElement . contains ( elemOnTop ) || elemOnTop === this . _box ;
306
+ isVisible = isVisible ||
307
+ node . parentElement . contains ( elemOnTop ) ||
308
+ this . _wrapper . contains ( elemOnTop ) ;
307
309
}
308
310
else {
309
311
const clientRect = node . getClientRects ( ) [ 0 ] ;
310
312
position . top = clientRect . top + clientRect . height - 10 + window . scrollY ;
311
313
position . left = clientRect . left + window . screenX ;
312
314
const elemOnTop = document . elementFromPoint ( clientRect . left + clientRect . width / 2 , clientRect . top + clientRect . height / 2 ) ;
313
- isVisible = isVisible || node . contains ( elemOnTop ) || elemOnTop === this . _box ;
315
+ isVisible = isVisible ||
316
+ node . contains ( elemOnTop ) ||
317
+ this . _wrapper . contains ( elemOnTop ) ;
314
318
}
315
319
if ( ! isVisible ) {
316
320
continue ;
Original file line number Diff line number Diff line change @@ -359,13 +359,17 @@ class LiveTranslatorManager {
359
359
position . top = clientRect . top + window . scrollY
360
360
position . left = clientRect . left + window . screenX
361
361
const elemOnTop = document . elementFromPoint ( clientRect . left + clientRect . width / 2 , clientRect . top + clientRect . height / 2 )
362
- isVisible = isVisible || node . parentElement . contains ( elemOnTop ) || elemOnTop === this . _box
362
+ isVisible = isVisible ||
363
+ node . parentElement . contains ( elemOnTop ) ||
364
+ this . _wrapper . contains ( elemOnTop )
363
365
} else {
364
366
const clientRect = node . getClientRects ( ) [ 0 ]
365
367
position . top = clientRect . top + clientRect . height - 10 + window . scrollY
366
368
position . left = clientRect . left + window . screenX
367
369
const elemOnTop = document . elementFromPoint ( clientRect . left + clientRect . width / 2 , clientRect . top + clientRect . height / 2 )
368
- isVisible = isVisible || node . contains ( elemOnTop ) || elemOnTop === this . _box
370
+ isVisible = isVisible ||
371
+ node . contains ( elemOnTop ) ||
372
+ this . _wrapper . contains ( elemOnTop )
369
373
}
370
374
if ( ! isVisible ) {
371
375
continue
You can’t perform that action at this time.
0 commit comments