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

Improve keyboard shortcut handling for modals with forms #2899

Open
yomybaby opened this issue Nov 29, 2024 · 0 comments · May be fixed by #2907
Open

Improve keyboard shortcut handling for modals with forms #2899

yomybaby opened this issue Nov 29, 2024 · 0 comments · May be fixed by #2907

Comments

@yomybaby
Copy link
Member

yomybaby commented Nov 29, 2024

Description

Currently, pressing the ESC key closes the some modal of the WebUI, which is convenient but can be problematic when filling out a form. Users may accidentally close the modal while entering data. To address this issue, we propose the following improvements for modals containing forms:

  1. When a modal with a form is opened, the first form item should automatically receive focus.
  2. If the focused form item is active, pressing ESC should blur the focus instead of closing the modal.
  3. The modal should only close when ESC is pressed and no form item is focused.

Affected Version

This change should be applied to BAIModal in the Backend.AI WebUI.

Steps to Reproduce

  1. Open a modal containing a form in the WebUI.
  2. Start filling out the form.
  3. Press ESC and observe that the modal closes, potentially losing unsaved data.

Expected Behavior

  • The first form item should be focused when the modal opens.
  • Pressing ESC should blur the focus if a form item is focused.
  • The modal should only close when no form item is focused.

Additional Context

This improvement aims to enhance user experience by preventing accidental closure of modals with forms.

@yomybaby yomybaby changed the title Improve keyboard shortcut handling for modals with forms in Web UI Improve keyboard shortcut handling for modals with forms Nov 29, 2024
@yomybaby yomybaby linked a pull request Dec 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant