-
Notifications
You must be signed in to change notification settings - Fork 0
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
THEOC-1722: Update dropdown to not close unless clicking outside #322
base: master
Are you sure you want to change the base?
Conversation
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.
This seems like it fixes the issue. But I don't really get the use case for the controlledIsOpen
prop, and the naming of it seems confusing. And this is changing the default behavior of the Dropdown so could be changing the behavior of anything that uses the Dropdown. Not sure if anything relied on the behavior as it was but we might want to keep the same defaults and override it in the place where you're using this?
<StyledMenu width={width} data-qaid={`${qaId}-flyout`}> | ||
<StyledMenu | ||
width={width} | ||
ref={menuRef} |
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.
do we also need to add the menuRef in the case where flyoutContainer == false
? I get kind of unexpected behavior in your storybook story where flyoutContainer={false}
when keepOpenOnClick
is true
, because it's passing menuRef
into the useOutsideClick
but not rendering any element with ref={menuRef}
. Might be able to just do this on line 105:
<div ref={menuRef}>
{children}
</div>
Dropdown doesn't close unless clicking outside of ref zone. Also expose isOpen as updatedIsOpen to allow component to control if we want alternative functionality.
How Has This Been Tested?
Types of changes
Checklist: