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]: Modal Dialog form field focus is broken #100

Open
PerryCodes opened this issue Feb 21, 2025 · 0 comments
Open

[BUG]: Modal Dialog form field focus is broken #100

PerryCodes opened this issue Feb 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@PerryCodes
Copy link

PerryCodes commented Feb 21, 2025

Describe the bug
Both mouse and keyboard methods for establishing focus on form fields are not working correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'User List' page
  2. Click on 'Add User' button
  3. Observe the 'First Name' Input field has focus
  4. Press the 'Tab' key
    OR
    Attempt to click the 'Last Name' Input field with the mouse
  5. In either case, incorrect behavior is observed. When pressing 'Tab', the Dialog becomes focused instead of the next form field. Pressing 'Tab' again returns focus back to 'First Name'. When using the mouse, the first click also sets focus to the Dialog. A second click is necessary for 'Last Name' to receive focus.

Expected behavior
In both cases, with the keyboard or mouse, I would expect the "Last Name" field to receive focus. Where 'Tab' presses are concerned, I would never expect the Dialog to receive focus. The is the behavior you see in the official documentation for the shadcn/ui Dialog component here: https://ui.shadcn.com/docs/components/dialog

Screenshots
n/a

Additional context
n/a

@PerryCodes PerryCodes added the bug Something isn't working label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant