When you add a new tab and select the tab in the same frame, the indicator is unable to retrieve meta data about the tab, because it hasn't been rendered yet.
Related to this line: https://github.com/callemall/material-ui/blob/v1.0.0-beta.5/src/Tabs/Tabs.js#L161
https://codesandbox.io/s/4z17ol2jmw
Because this is in -beta.5, should I work on that version? Or should I verify the same thing is happening in the latest version of the beta branch, then attempt to fix it there?
@Seurimas are you working on this?
I'm not working on this. Also, swapping in -beta.7 for the sandbox still exhibits the issue: https://codesandbox.io/s/98p8lq9xjo
eventually this is a bit shortsighted, but wouldn't moving
componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value) {
this.updateIndicatorState(nextProps);
}
}
to componentDidUpdate do the trick?
componentDidUpdate(prevProps, prevState) {
(...)
f (this.props.value !== prevProps.value) {
this.updateIndicatorState(this.props);
}
}
Most helpful comment
eventually this is a bit shortsighted, but wouldn't moving
to componentDidUpdate do the trick?