Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: memoize DropdownContentRoot #423

Merged
merged 1 commit into from
Oct 30, 2019
Merged

Conversation

koba04
Copy link
Contributor

@koba04 koba04 commented Oct 29, 2019

This fixes a bug that DrowdownContent loses the state when an update happens outside its Dropdown.
The state includes a focus state, a controlled value, and so on.

This is caused by that DropdownContentRoot is created at every time when Dropdown is rendered.
So I've fixed the issue to memoize DropdownContentRoot using useMemo.

@koba04 koba04 requested a review from a team as a code owner October 29, 2019 16:53
@reg-suit
Copy link

reg-suit bot commented Oct 29, 2019

✨✨ That's perfect, there is no visual difference! ✨✨

Check out the report here.

@ghost ghost requested review from cidermitaina and removed request for a team October 29, 2019 16:53
@koba04 koba04 requested a review from nabeliwo October 29, 2019 16:53
Copy link
Member

@nabeliwo nabeliwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a really big help.
Thank you 🎉

@nabeliwo nabeliwo merged commit 9adfa23 into features/ttmz Oct 30, 2019
@nabeliwo nabeliwo deleted the fix-dropdown-state branch October 30, 2019 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants