Skip to content

Commit b5a66ac

Browse files
author
Eric Olkowski
committed
Attempted other solution
1 parent 9215107 commit b5a66ac

File tree

1 file changed

+7
-4
lines changed
  • packages/react-core/src/components/Tabs

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ class Tabs extends Component<TabsProps, TabsState> {
360360
currentLinkAccentStart: `${startValue}px`,
361361
...(shouldInitializeStyle && { isInitializingAccent: true })
362362
});
363-
364-
requestAnimationFrame(() => {
365-
this.setState({ isInitializingAccent: false });
366-
});
367363
};
368364

369365
handleResize = () => {
@@ -442,6 +438,13 @@ class Tabs extends Component<TabsProps, TabsState> {
442438
if (prevState.uncontrolledIsExpandedLocal !== this.state.uncontrolledIsExpandedLocal) {
443439
this.setAccentStyles(true);
444440
}
441+
442+
if (
443+
(parseInt(prevState.currentLinkAccentLength) === 0 && parseInt(this.state.currentLinkAccentLength) !== 0) ||
444+
prevState.currentLinkAccentStart !== this.state.currentLinkAccentStart
445+
) {
446+
this.setState({ isInitializingAccent: false });
447+
}
445448
}
446449

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

0 commit comments

Comments
 (0)