You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently impossible to create a HTML button like this: <button aria-disabled="true">click me</button>. Given the following snippet of JSX, where we create two buttons. One explicitly marked as disabled and another one marked as aria-disabled.
When executing this on a native platform, like the iOS simulator, both buttons are marked with the trait "Not Enabled" when inspecting them with the Accessibility Inspector. When clicking the first button no alert is triggered, when clicking the second button the onPress function is executed and thus an alert is triggered.
While the behavior in a browser is the same, the DOM output does not reflect this. The aria-disabled attributed is stripped away completely. The snippet below shows the output.
On the web-version the aria-disabled attribute should be maintained. However this does not mean that the button should have the property disabled as well. For accessibility reasons it is common practice to only mark the button as disabled with the aria-disabled attribute. This allows a user to still being able to focus the button, additionally click it, and have feedback from the screenreader about the action. When adding the disabled button, most screenreader do not allow to focus the button anymore.
Is there an existing issue for this?
Describe the issue
It is currently impossible to create a HTML button like this:
<button aria-disabled="true">click me</button>
. Given the following snippet of JSX, where we create two buttons. One explicitly marked asdisabled
and another one marked asaria-disabled
.When executing this on a native platform, like the iOS simulator, both buttons are marked with the trait "Not Enabled" when inspecting them with the Accessibility Inspector. When clicking the first button no alert is triggered, when clicking the second button the
onPress
function is executed and thus an alert is triggered.While the behavior in a browser is the same, the DOM output does not reflect this. The
aria-disabled
attributed is stripped away completely. The snippet below shows the output.Expected behavior
On the web-version the
aria-disabled
attribute should be maintained. However this does not mean that the button should have the propertydisabled
as well. For accessibility reasons it is common practice to only mark the button as disabled with thearia-disabled
attribute. This allows a user to still being able to focus the button, additionally click it, and have feedback from the screenreader about the action. When adding thedisabled
button, most screenreader do not allow to focus the button anymore.Steps to reproduce
The supplied snippets should be sufficient.
Test case
https://codesandbox.io/p/sandbox/gracious-matan-3vhxly
Additional comments
No response
The text was updated successfully, but these errors were encountered: