File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2929 display : flex ;
3030 height : 100% ;
3131 overflow : inherit ;
32+ scroll-behavior : inherit ;
33+ scrollbar-width : inherit ;
3234 justify-content : space-between ;
3335 width : 100% ;
3436 }
Original file line number Diff line number Diff line change @@ -157,8 +157,11 @@ export class Tabs extends LitElement {
157157 const min = offset - scrollMargin ;
158158 const max = offset + extent - hostExtent + scrollMargin ;
159159 const to = Math . min ( min , Math . max ( max , scroll ) ) ;
160- // TODO(b/299934312): improve focus smoothness
161- const behavior : ScrollBehavior = ! this . focusedTab ? 'smooth' : 'instant' ;
160+ // When a tab is focused, use 'auto' to use the CSS `scroll-behavior`. The
161+ // default behavior is smooth scrolling. However, when there is not a tab
162+ // focused on initialization, use 'instant' to immediately bring the focused
163+ // tab into view.
164+ const behavior : ScrollBehavior = ! this . focusedTab ? 'instant' : 'auto' ;
162165 this . tabsScrollerElement . scrollTo ( { behavior, top : 0 , left : to } ) ;
163166 }
164167
You can’t perform that action at this time.
0 commit comments