File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
core/pfe-core/controllers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ export class OverflowController implements ReactiveController {
4242 }
4343 this . overflowLeft = ! this . #hideOverflowButtons && ! isElementInView ( this . #container, this . firstItem ) ;
4444 this . overflowRight = ! this . #hideOverflowButtons && ! isElementInView ( this . #container, this . lastItem ) ;
45- this . showScrollButtons = ! this . #hideOverflowButtons && ( this . overflowLeft || this . overflowRight ) ;
45+ let scrollButtonsWidth = 0 ;
46+ if ( this . overflowLeft || this . overflowRight ) {
47+ scrollButtonsWidth = ( this . #container. parentElement ?. querySelector ( 'button' ) ?. getBoundingClientRect ( ) . width || 0 ) * 2 ;
48+ }
49+ this . showScrollButtons = ! this . #hideOverflowButtons &&
50+ this . #container. scrollWidth > ( this . #container. clientWidth + scrollButtonsWidth ) ;
4651 this . host . requestUpdate ( ) ;
4752 }
4853
You can’t perform that action at this time.
0 commit comments