File tree 2 files changed +24
-1
lines changed
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,8 @@ class TabContainer extends UI5Element {
446
446
this . _updateScrolling ( ) ;
447
447
}
448
448
449
- _closeRespPopover ( ) {
449
+ async _closeRespPopover ( ) {
450
+ this . responsivePopover = await this . _respPopover ( ) ;
450
451
this . responsivePopover . close ( ) ;
451
452
}
452
453
@@ -456,6 +457,10 @@ class TabContainer extends UI5Element {
456
457
this . _scrollable = headerScrollContainer . offsetWidth < headerScrollContainer . scrollWidth ;
457
458
this . _scrollableBack = headerScrollContainer . scrollLeft > 0 ;
458
459
this . _scrollableForward = Math . ceil ( headerScrollContainer . scrollLeft ) < headerScrollContainer . scrollWidth - headerScrollContainer . offsetWidth ;
460
+
461
+ if ( ! this . _scrollable ) {
462
+ this . _closeRespPopover ( ) ;
463
+ }
459
464
}
460
465
461
466
_getHeader ( ) {
Original file line number Diff line number Diff line change @@ -67,6 +67,24 @@ describe("TabContainer general interaction", () => {
67
67
68
68
assert . ok ( ! arrowLeft . isDisplayed ( ) , "'Left Arrow' should be hidden after 'Left arrow' click" ) ;
69
69
assert . ok ( arrowRight . isDisplayed ( ) , "'Right Arrow' should be visible after 'Left arrow' click" ) ;
70
+
71
+ // act: open overflow
72
+ const overflowBtn = browser . $ ( "#tabContainerTextOnly" ) . shadow$ ( ".ui-tc__overflowButton" ) ;
73
+ overflowBtn . click ( ) ;
74
+
75
+ // assert: the overflow popover is open.
76
+ const staticAreaItemClassName = browser . getStaticAreaItemClassName ( "#tabContainerTextOnly" )
77
+ const overflowPopover = browser . $ ( `.${ staticAreaItemClassName } ` ) . shadow$ ( "ui5-responsive-popover" ) ;
78
+ assert . strictEqual ( overflowPopover . isDisplayedInViewport ( ) , true ,
79
+ "Popover is open." ) ;
80
+
81
+ // act: resize, so the overflow button is not visible
82
+ browser . setWindowSize ( 1400 , 1080 ) ;
83
+ browser . pause ( 500 ) ;
84
+
85
+ // assert: the overflow popover is closed.
86
+ assert . strictEqual ( overflowPopover . isDisplayedInViewport ( ) , false ,
87
+ "Popover is closed." ) ;
70
88
} ) ;
71
89
72
90
it ( "tests if content is scrollable when tabcontainer takes limited height by its parent" , ( ) => {
You can’t perform that action at this time.
0 commit comments