-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add keyboard keys to remove focus on input fields #733
Conversation
This pull request is deployed at test.admin-interface.opencast.org/733/2024-07-11_12-13-21/ . |
Use Run test server using develop.opencast.org as backend:
Specify a different backend like stable.opencast.org:
It may take a few seconds for the interface to spin up. |
I don't understand the point of this pull request. There is already a key handler in RenderField.
And you can already use "Escape", "Tab", "Enter" to leave the input field. |
This is true, but it doesn't apply to all field components, as not all of them have a component property. In these cases, a simple HTML input will be used, which does not support Enter and ESC keys (at least in Firefox). For example, in the create user dialog, the RenderField or RenderMutlifield is not passed as component prop. To avoid redundant code, I created this wrapper that adds this key down handler to all Field components. If a component prop with value such as RenderField is passed, this handler will be ignored in the RenderField component. |
This pull request has conflicts ☹ |
8b545d5
to
172a3bf
Compare
Then, do we still need the code in |
Yes, because the handler in |
This pull request has conflicts ☹ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I can see developers accidentally importing the wrong Field component in the future, this does seem like the most reasonable solution to the given problem. Works and can be merged after the current merge conflicts are fixed imo.
For stuff like the "Add User" oder "Create group" modals, it might be better if the |
3cd2cdf
to
ce7cc7b
Compare
Adds a keyboard event handler to remove the focus from input elements when the
esc
orenter
key are pressed. This pull request is based on #643 (comment).Close #643