-
Notifications
You must be signed in to change notification settings - Fork 103
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(Dropdown): visibility is controlled when undefined #202
base: master
Are you sure you want to change the base?
Conversation
Fix an issue where the visibility property becomes controlled if the visible PROP is defined, but it's VALUE is undefined
Add a test case for this? |
I modified an existing test case. Would you like me to create a separate case for this instead? |
It's better to provide a separate case. |
Created a separate test case for when visibility is undefined
@MadCcc , I went ahead and created a separate case |
rc-trigger is updated, you need to update your dependencies and run snapshot again. |
Updated the rc-trigger dependency per PR comment.
I updated the minimum version for |
It will be a breaking change. |
Fix issues with tests. Removed accidentially commited snapshot and also editing existing snapshot after updating rc-trigger
@@ -10,7 +10,7 @@ Array [ | |||
<div> | |||
<div | |||
class="rc-dropdown" | |||
style="opacity: 0; pointer-events: none;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this was caused by updating the rc-trigger
minor version.
Ah, good catch. I honestly didn't think about that. I assume package updates are handled separately, or do I bump the version as part of this CR? What would you like me to do from here to get this through, given that it's a breaking change? Or do we want to push this off until later? I think it's important to add for consistency's sake, and users can employ workarounds. |
Currently, react-component/dropdown checks the existance of the visibility key in props to determine whether or not the visibility prop is controlled or not. However, it should check for undefined instead. This will support the following behavior:
A workaround would be to use the spread operator or something similar to ensure that if visible is undefined, we don't pass down the visible key