@@ -57,6 +57,18 @@ const metadata = {
57
57
individualSlots : true ,
58
58
listenFor : { include : [ "*" ] } ,
59
59
} ,
60
+
61
+ /**
62
+ * Defines the button which will open the overflow menu. If nothing is provided to this slot, the default button will be used.
63
+ *
64
+ * @type {HTMLElement[] }
65
+ * @public
66
+ * @slot
67
+ * @since 1.0.0-rc.9
68
+ */
69
+ overflowButton : {
70
+ type : HTMLElement ,
71
+ } ,
60
72
} ,
61
73
properties : /** @lends sap.ui.webcomponents.main.TabContainer.prototype */ {
62
74
/**
@@ -427,9 +439,19 @@ class TabContainer extends UI5Element {
427
439
}
428
440
429
441
async _onOverflowButtonClick ( event ) {
442
+ const button = this . overflowButton [ 0 ] || this . getDomRef ( ) . querySelector ( ".ui-tc__overflowButton > ui5-button" ) ;
443
+
444
+ if ( event . target !== button ) {
445
+ return ;
446
+ }
447
+
430
448
this . responsivePopover = await this . _respPopover ( ) ;
431
449
this . updateStaticAreaItemContentDensity ( ) ;
432
- this . responsivePopover . open ( this . getDomRef ( ) . querySelector ( ".ui-tc__overflowButton" ) ) ;
450
+ if ( this . responsivePopover . opened ) {
451
+ this . responsivePopover . close ( ) ;
452
+ } else {
453
+ this . responsivePopover . open ( button ) ;
454
+ }
433
455
}
434
456
435
457
_onHeaderBackArrowClick ( ) {
@@ -480,6 +502,10 @@ class TabContainer extends UI5Element {
480
502
return staticAreaItem . querySelector ( `#${ this . _id } -overflowMenu` ) ;
481
503
}
482
504
505
+ get shouldShowOverflow ( ) {
506
+ return this . showOverflow && this . _scrollable ;
507
+ }
508
+
483
509
get classes ( ) {
484
510
return {
485
511
root : {
@@ -509,10 +535,6 @@ class TabContainer extends UI5Element {
509
535
"ui5-tc__headerArrowRight" : true ,
510
536
"ui5-tc__headerArrow--visible" : this . _scrollableForward ,
511
537
} ,
512
- overflowButton : {
513
- "ui-tc__overflowButton" : true ,
514
- "ui-tc__overflowButton--visible" : this . _scrollable ,
515
- } ,
516
538
content : {
517
539
"ui5-tc__content" : true ,
518
540
"ui5-tc__content--collapsed" : this . _contentCollapsed ,
0 commit comments