Skip to content

Commit 9215107

Browse files
author
Eric Olkowski
committed
fix(Tabs): updated logic for uncontrolled tabs animation
1 parent 6bcad45 commit 9215107

File tree

1 file changed

+6
-2
lines changed
  • packages/react-core/src/components/Tabs

1 file changed

+6
-2
lines changed

packages/react-core/src/components/Tabs/Tabs.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ class Tabs extends Component<TabsProps, TabsState> {
361361
...(shouldInitializeStyle && { isInitializingAccent: true })
362362
});
363363

364-
setTimeout(() => {
364+
requestAnimationFrame(() => {
365365
this.setState({ isInitializingAccent: false });
366-
}, 0);
366+
});
367367
};
368368

369369
handleResize = () => {
@@ -438,6 +438,10 @@ class Tabs extends Component<TabsProps, TabsState> {
438438
} else if (prevState.enableScrollButtons && !enableScrollButtons) {
439439
this.setState({ showScrollButtons: false });
440440
}
441+
442+
if (prevState.uncontrolledIsExpandedLocal !== this.state.uncontrolledIsExpandedLocal) {
443+
this.setAccentStyles(true);
444+
}
441445
}
442446

443447
static getDerivedStateFromProps(nextProps: TabsProps, prevState: TabsState) {

0 commit comments

Comments
 (0)