File tree 2 files changed +51
-1
lines changed
2 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -489,7 +489,8 @@ class Popover extends Popup {
489
489
490
490
this . _maxContentHeight = maxContentHeight ;
491
491
492
- const arrowTranslateX = isVertical ? targetRect . left + targetRect . width / 2 - left - popoverSize . width / 2 : 0 ;
492
+ const arrowXCentered = this . horizontalAlign === PopoverHorizontalAlign . Center || this . horizontalAlign === PopoverHorizontalAlign . Stretch ;
493
+ const arrowTranslateX = isVertical && arrowXCentered ? targetRect . left + targetRect . width / 2 - left - popoverSize . width / 2 : 0 ;
493
494
const arrowTranslateY = ! isVertical ? targetRect . top + targetRect . height / 2 - top - popoverSize . height / 2 : 0 ;
494
495
495
496
if ( this . _left === undefined || Math . abs ( this . _left - left ) > 1.5 ) {
Original file line number Diff line number Diff line change 314
314
</ ui5-list >
315
315
</ ui5-popover >
316
316
317
+ < br >
318
+ < br >
319
+ < div id ="targetOpener " style ="height: 3rem; background: red; "> </ div >
320
+
321
+ < ui5-button id ="btnOpenXLeft "> Open Popup Left aligned</ ui5-button >
322
+
323
+ < ui5-popover
324
+ header-text ="My Heading "
325
+ id ="popXLeft " horizontal-align ="Left "
326
+ style ="width: 300px ">
327
+ < div slot ="header ">
328
+ < ui5-button id ="first-focusable "> I am in the header</ ui5-button >
329
+ </ div >
330
+ < div >
331
+ < ui5-button id ="first-focusable "> I am in the header</ ui5-button >
332
+ </ div >
333
+ < div >
334
+ < ui5-button id ="first-focusable "> I am in the header</ ui5-button >
335
+ </ div >
336
+ </ ui5-popover >
337
+
338
+ < div id ="targetOpener2 " style ="height: 3rem; background: yellow; "> </ div >
339
+
340
+ < ui5-button id ="btnOpenXRight "> Open Popup Right aligned</ ui5-button >
341
+
342
+ < ui5-popover
343
+ header-text ="My Heading "
344
+ id ="popXRight " horizontal-align ="Right "
345
+ style ="width: 300px ">
346
+ < div slot ="header ">
347
+ < ui5-button id ="first-focusable "> I am in the header</ ui5-button >
348
+ </ div >
349
+ < div >
350
+ < ui5-button id ="first-focusable "> I am in the header</ ui5-button >
351
+ </ div >
352
+ < div >
353
+ < ui5-button id ="first-focusable "> I am in the header</ ui5-button >
354
+ </ div >
355
+ </ ui5-popover >
356
+
357
+ < br >
358
+ < br >
359
+
317
360
< script >
318
361
btn . addEventListener ( "click" , function ( event ) {
319
362
pop . openBy ( btn ) ;
380
423
381
424
btnQuickViewCardOpener . setAttribute ( "hidden" , true ) ;
382
425
} )
426
+ btnOpenXLeft . addEventListener ( "click" , function ( event ) {
427
+ popXLeft . openBy ( targetOpener ) ;
428
+ } ) ;
429
+ btnOpenXRight . addEventListener ( "click" , function ( event ) {
430
+ popXRight . openBy ( targetOpener2 ) ;
431
+ } ) ;
383
432
</ script >
384
433
</ body >
385
434
You can’t perform that action at this time.
0 commit comments