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

Dropdown menu automatically closed whenever onValueChange() sets selectedValue prop. #70

Closed
naytun opened this issue Apr 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@naytun
Copy link

naytun commented Apr 26, 2024

The dropdown menu automatically closes whenever onValueChange() sets the selectedValue prop. I require the dropdown menu to keep opening until the user closes manually by selecting background overlay (or) programmatically triggered to close the dropdown menu, if possible.

It also would be nice if we had onClose callback function as a prop! 👍🏻
Here's the code excerpt...

  const [groupItem, setGroupItem] = useState()
  ...
  
  <Dropdown
      isMultiple
      selectedValue={groupItem}
      onValueChange={(value) => {
         setGroupItem(value)
      }}
      ...
    />
@azeezat
Copy link
Owner

azeezat commented Aug 30, 2024

A new prop autoCloseOnSelect={false} can now be applied on the component. It works with single selection.

Additionally, if you would like to perform another action when the modal is closed/opened, use the following props

modalControls={{
              modalProps: {
                onShow: () => console.log('modal opened'),
                onDismiss: () => console.log('modal was dismissed')
              },
            }}
            

@azeezat azeezat closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants