File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -668,6 +668,11 @@ class Popover extends Popup {
668
668
safeRangeForArrowX ,
669
669
) ;
670
670
671
+ if ( isVertical ) {
672
+ // if the target is with small width - only icon button for example
673
+ const arrowTranslateXMinimum = - ( popoverSize . width / 2 - ( targetRect . width / 2 + targetRect . left ) + ARROW_SIZE ) ;
674
+ arrowTranslateX = ( arrowTranslateX < arrowTranslateXMinimum ) ? arrowTranslateX : arrowTranslateXMinimum ;
675
+ }
671
676
return {
672
677
x : Math . round ( arrowTranslateX ) ,
673
678
y : Math . round ( arrowTranslateY ) ,
Original file line number Diff line number Diff line change 20
20
: host ([actual-placement-type = "Bottom" ]) .ui5-popover-arrow {
21
21
left : calc (50% - 0.5625rem );
22
22
top : -0.5rem ;
23
- height : 0.5625 rem ;
23
+ height : 0.5 rem ;
24
24
}
25
25
26
26
: host ([actual-placement-type = "Bottom" ]) .ui5-popover-arrow : after {
74
74
.ui5-popover-arrow {
75
75
pointer-events : none;
76
76
display : block;
77
- width : 1rem ;
77
+ width : calc ( 1rem + 2 px ) ;
78
78
height : 1rem ;
79
79
position : absolute;
80
80
overflow : hidden;
Original file line number Diff line number Diff line change 343
343
< br >
344
344
< br >
345
345
346
+ < div class ="popover12auto-left ">
347
+ < ui5-button id ="btnOpenDynamicLeft " icon ="overflow "> </ ui5-button >
348
+ </ div >
349
+
346
350
< div class ="popover12auto ">
347
351
< ui5-button id ="btnOpenDynamic " icon ="overflow "> </ ui5-button >
348
352
</ div >
@@ -558,6 +562,20 @@ <h2>Horizontal Align</h2>
558
562
popNoFocusableContent . showAt ( event . target ) ;
559
563
} ) ;
560
564
565
+ btnOpenDynamicLeft . addEventListener ( "click" , function ( ) {
566
+ var popoverLeft = document . createElement ( "ui5-popover" ) ,
567
+ buttonLeft = document . createElement ( "ui5-button" ) ;
568
+
569
+ buttonLeft . textContent = "Focusable element" ;
570
+ popoverLeft . appendChild ( buttonLeft ) ;
571
+ popoverLeft . setAttribute ( "id" , "dynamic-popover-left" ) ;
572
+ popoverLeft . setAttribute ( "placement-type" , "Bottom" ) ;
573
+
574
+ document . body . appendChild ( popoverLeft ) ;
575
+
576
+ popoverLeft . showAt ( btnOpenDynamicLeft ) ;
577
+ } ) ;
578
+
561
579
btnOpenDynamic . addEventListener ( "click" , function ( ) {
562
580
var popover = document . createElement ( "ui5-popover" ) ,
563
581
button = document . createElement ( "ui5-button" ) ;
You can’t perform that action at this time.
0 commit comments