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 29
29
display : flex ;
30
30
height : 100% ;
31
31
overflow : inherit ;
32
+ scroll-behavior : inherit ;
33
+ scrollbar-width : inherit ;
32
34
justify-content : space-between ;
33
35
width : 100% ;
34
36
}
Original file line number Diff line number Diff line change @@ -157,8 +157,11 @@ export class Tabs extends LitElement {
157
157
const min = offset - scrollMargin ;
158
158
const max = offset + extent - hostExtent + scrollMargin ;
159
159
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' ;
162
165
this . tabsScrollerElement . scrollTo ( { behavior, top : 0 , left : to } ) ;
163
166
}
164
167
You can’t perform that action at this time.
0 commit comments