Closed langemike closed 3 months ago
@AntonLantukh I get the following error for the deploy preview / lighthouse test
throw new Error(`Input required and not supplied: ${name}`);
Is there something I can do this fix this? I do not understand the cause as it seems unrelated to my minor change.
^ should be fixed in the next PR because @langemike was not a contributor yet when submitting this PR (GitHub security)
When submitting a form, the submit button gets disabled. This causes a bug on the Android screen reader. The button focus is lost and is set to the body-element instead. This causes the page title to be read by the screen reader instead of a potential form error message.
Removing the
disabled
attribute - while maintaining thearia-disabled
attribute - to fix the issue raises the question where the focus should be set when a generic error occurs. This error message is invisible when it's a validation error and visible on any other error. I reasoned to keep it simple: maintain the focus on the submit-button, so the users know where they are in the UI instead of moving the focus to something that we consider the most "relevant" element.A disabled button should still be able to receive focus and be read by the screen reader. A good example is the "Start Watching" button which can be in a disabled-state for an upcoming live event.
aria-disabled
has the same purpose as the nativedisabled
attribute, but thedisabled
attribute makes the button non-focusable/tabbable causing this issue. Strangely enough only for submit-buttons and on Android...Some related articles: