opencast / opencast-admin-interface

A modern admin user interface for Opencast
https://admin-interface.opencast.org
Educational Community License v2.0
1 stars 22 forks source link

Some input fields are missing keyboard accessibility/convenience #643

Open owi92 opened 3 weeks ago

owi92 commented 3 weeks ago

Many input fields in several modals can be "unfocused" with the esc and enter keys. However this isn't the case for every field since some of them are missing the necessary onKeyDown handlers. This is the case for input fields in the modals for "add user", "add group", "add access policy" and "add theme" (but I'm sure there are others as well). Fixing this would increase accessibility, convenience and coherence.

Edit: This came up in #619 and was probably also mentioned in serveral a11y related issues.

owi92 commented 3 weeks ago

Well so far I've only got a somewhat hacky feeling band-aid solution for this. That would be to add the following prop to every <Field> missing the keyboard functionality:

onKeyDown={(event: KeyboardEvent) => {
    if (event.key === "Enter" || event.key === "Escape") {
        (document.activeElement as HTMLInputElement).blur();
    }
}}

I would honestly prefer another solution but haven't got the time right now, so I'll unassign myself for now.

ziegenberg commented 3 weeks ago

@owi92 Thx for reporting! :)