Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

fix(tabs): dropdown label matches updated tabs #2196

Closed
wants to merge 1 commit into from

Conversation

jinhei
Copy link

@jinhei jinhei commented Apr 11, 2019

This PR fixes #2204 where the wrong selected dropdown label is shown when props.children and props.selected are both updated.

Currently, updating props.children and props.selected at the same time uses prevProps.children's label in the dropdown. This occurs because getTabAt checks the refs cached in the class, which are not updated until ref is called (after selectedLabel is populated).

@netlify
Copy link

netlify bot commented Apr 11, 2019

Deploy preview for carbon-components-react ready!

Built with commit 43ae151

https://deploy-preview-2196--carbon-components-react.netlify.com

@asudoh
Copy link
Contributor

asudoh commented Apr 11, 2019

Hi @jinhei could you create an issue with a reduced case based on https://codesandbox.io/s/github/IBM/carbon-components-react/tree/master/examples/codesandbox? We encourage contributors to enter issues accompanied with PRs except for small/internal chores. Thanks!

@jinhei
Copy link
Author

jinhei commented Apr 11, 2019

@asudoh See #2204

@asudoh
Copy link
Contributor

asudoh commented Apr 18, 2019

Superseded by #2224 - Sorry for this, I found tabsWithProps won't be the best fit.

@asudoh asudoh closed this Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs dropdown label references cached tab label
2 participants