File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,10 @@ class Popover extends Popup {
270
270
return PopoverTemplate ;
271
271
}
272
272
273
+ static get MIN_OFFSET ( ) {
274
+ return 10 ; // px
275
+ }
276
+
273
277
isOpenerClicked ( event ) {
274
278
const target = event . target ;
275
279
return target === this . _opener || ( target . getFocusDomRef && target . getFocusDomRef ( ) === this . _opener ) ;
@@ -404,12 +408,15 @@ class Popover extends Popup {
404
408
405
409
this . _oldPlacement = placement ;
406
410
411
+ const popoverOnLeftBorder = this . _left === 0 ;
412
+ const popoverOnTopBorder = this . _top === 0 ;
413
+
407
414
this . actualPlacementType = placement . placementType ;
408
- this . arrowTranslateX = placement . arrowX ;
409
- this . arrowTranslateY = placement . arrowY ;
415
+ this . arrowTranslateX = popoverOnLeftBorder ? placement . arrowX - Popover . MIN_OFFSET : placement . arrowX ;
416
+ this . arrowTranslateY = popoverOnTopBorder ? placement . arrowY - Popover . MIN_OFFSET : placement . arrowY ;
410
417
411
- this . style . left = `${ this . _left } px` ;
412
- this . style . top = `${ this . _top } px` ;
418
+ this . style . left = `${ popoverOnLeftBorder ? Popover . MIN_OFFSET : this . _left } px` ;
419
+ this . style . top = `${ popoverOnTopBorder ? Popover . MIN_OFFSET : this . _top } px` ;
413
420
this . show ( ) ;
414
421
415
422
if ( stretching && this . _width ) {
You can’t perform that action at this time.
0 commit comments