Open MuazAsif-Dev opened 1 year ago
Following this issue
I have the same issue. When I click on Select it opens, but when I click on Select itself, it doesn't close the popover. Surprisingly this is working fine on the NextUI document page! Any updates on this?
@ahmadbafrani this has been fixed in canary branch. It will be available in the next release, which will be taken place later today.
@wingkwong , @ahmadbafrani kindly close it as #completed
@abhinandan-verma my comment was only for his case only, not for the original issue posted here. Need to double check if it is still reproducible or not.
I have the same problem with the autocomplete. I have a contact list with autocomplete, when the search yields no results through emptyContent I display a button that when clicked opens the modal object and should close the autocomplete list. The modal opens but the list remains open and visible on the layer of the modal.
<Autocomplete
isRequired
isOpen={isOpenSender}
onOpenChange={(open) => setIsOpenSender(open)}
label="Mittente"
defaultItems={senders || []}
placeholder="Seleziona un mittente"
className="w-full"
listboxProps={{
emptyContent: (
<>
<span
className="text-xs text-gray-500 cursor-pointer ml-2"
onClick={() => setIsOpenSender(false)}
>
Not found
</span>
<Button onClick={() => handleCloseAutocomplete()}>
Add new contact
</Button>
</>
),
}}
onSelectionChange={(key) =>
handleSelectionChange(key, "DOCUMENTSENDERID")
}
defaultSelectedKey={formData?.DOCUMENTSENDERID?.toString()}
>
{(item) => (
<AutocompleteItem key={item.ID.toString()} value={item.ID}>
{item.NAME}
</AutocompleteItem>
)}
</Autocomplete>
NextUI Version
2.1.13
Describe the bug
In this example of the
Select
component, the onPress prop on the Button component is not acting as expected. Pressing (Key down or mouse click) opens the select popover but then only a Key down action can close the select component, clicking doesn't work.Using a native button element (btn in my example) with the onClick prop works as expected but the props on the Button component are not able to achieve consistent behavior across Mouse and Keyboard.
I have created a basic demo setup from scratch in the video below.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Expected behavior
The expected behavior when the select popover is open, and you click on the button again to toggle the open state, is for the popover to close.
What happens is that the select popover doesn't close on clicking the button.
Screenshots or Videos
https://github.com/nextui-org/nextui/assets/108615200/615d3796-5131-4278-98bd-9167afb56277
Operating System Version
Linux (Ubuntu 22)
Browser
Chrome