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

[BUG] - enter or space not selecting item in dropdown #3121

Closed
wingkwong opened this issue May 29, 2024 · 3 comments · Fixed by #3211 or #3240
Closed

[BUG] - enter or space not selecting item in dropdown #3121

wingkwong opened this issue May 29, 2024 · 3 comments · Fixed by #3211 or #3240
Assignees
Labels
🐛 Type: Bug Something isn't working

Comments

@wingkwong
Copy link
Member

wingkwong commented May 29, 2024

NextUI Version

2.4.0

Describe the bug

when you focus on the DropdownItem (after pressing tab until it gets focused), and then press Enter or Space, it closes without selecting the item. it was working on v2.2.10.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Go to a page that has Dropdown and other components
  2. open dropdown, and focus on the first item
  3. press space or enter
  4. Nothing gets selected
<Dropdown>
  <DropdownTrigger>
    <Button>Trigger</Button>
  </DropdownTrigger>
  <DropdownMenu aria-label="Actions" color={color} variant={variant}>
    <DropdownItem key="new" onPress={() => console.log("NOT WORKING WITH ENTER / SPACE")}>
      New file
    </DropdownItem>
    <DropdownItem key="copy">Copy link</DropdownItem>
    <DropdownItem key="edit">Edit file</DropdownItem>
    <DropdownItem key="delete" className="text-danger" color="danger">
      Delete file
    </DropdownItem>
  </DropdownMenu>
</Dropdown>

Expected behavior

Pressing the keyboard "Enter" or "Space" should select the item.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Chrome

@wingkwong wingkwong added the 🐛 Type: Bug Something isn't working label May 29, 2024
@wingkwong wingkwong added this to the v2.4.1 milestone May 29, 2024
Copy link

linear bot commented May 29, 2024

@jrgarciadev
Copy link
Member

@wingkwong also, pressing escape doesn't focus the trigger back

@wingkwong wingkwong self-assigned this May 30, 2024
@wingkwong wingkwong modified the milestones: v2.4.1, v2.4.2 May 31, 2024
@wingkwong
Copy link
Member Author

pressing escape doesn't focus the trigger back

focus issue has been fixed in #3187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants