@@ -54,6 +54,7 @@ export class TabBar<T> extends Widget {
5454 this . _document = options . document || document ;
5555 this . tabsMovable = options . tabsMovable || false ;
5656 this . titlesEditable = options . titlesEditable || false ;
57+ this . _scrollingEnabled = options . scrollingEnabled || false ;
5758 this . allowDeselect = options . allowDeselect || false ;
5859 this . addButtonEnabled = options . addButtonEnabled || false ;
5960 this . insertBehavior = options . insertBehavior || 'select-tab-if-needed' ;
@@ -1070,24 +1071,6 @@ export class TabBar<T> extends Widget {
10701071 detachRequested : false
10711072 } ;
10721073
1073- // Add the document pointer up listener.
1074- this . document . addEventListener ( 'pointerup' , this , true ) ;
1075-
1076- // Do nothing else if the middle button or add button is clicked.
1077- if ( event . button === 1 || addButtonClicked ) {
1078- return ;
1079- }
1080- if ( scrollBeforeButtonClicked || scrollAfterButtonClicked ) {
1081- this . beginScrolling ( scrollBeforeButtonClicked ? '-' : '+' ) ;
1082- return ;
1083- }
1084-
1085- // Do nothing else if the close icon is clicked.
1086- let icon = tabs [ index ] . querySelector ( this . renderer . closeIconSelector ) ;
1087- if ( icon && icon . contains ( event . target as HTMLElement ) ) {
1088- return ;
1089- }
1090-
10911074 // Add the extra listeners if the tabs are movable.
10921075 if ( this . tabsMovable ) {
10931076 this . document . addEventListener ( 'pointermove' , this , true ) ;
@@ -1683,6 +1666,13 @@ export namespace TabBar {
16831666 */
16841667 addButtonEnabled ?: boolean ;
16851668
1669+ /**
1670+ * Whether scrolling is enabled.
1671+ *
1672+ * The default is `false`.
1673+ */
1674+ scrollingEnabled ?: boolean ;
1675+
16861676 /**
16871677 * The selection behavior when inserting a tab.
16881678 *
0 commit comments