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

fix: 🐛 change disabled to readonly for form inputs #2618

Conversation

cameronperera
Copy link
Collaborator

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15666

Description

This addresses an a11y issue where we use the disabled attribute on our form inputs when reading a resource. The fix is to update the attribute to readonly. This allows the screen reader to actually see the content and keep the user from being able to edit the details of the resource until they enter edit mode.

This is a small change and as long as there is no disagreement with this approach, I can make a PR that will include a much larger number of fixes.

Screenshots (if appropriate)

Before:
Screenshot 2024-12-09 at 3 42 00 PM
After:
Screenshot 2024-12-09 at 3 42 28 PM

How to Test

Checklist

  • I have added before and after screenshots for UI changes
  • I have added JSON response output for API changes
  • I have added steps to reproduce and test for bug fixes in the description
  • I have commented on my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@cameronperera cameronperera self-assigned this Dec 9, 2024
@cameronperera cameronperera requested a review from a team as a code owner December 9, 2024 21:52
Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boundary-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 3:49pm
boundary-ui-desktop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 3:49pm

@calcaide
Copy link
Collaborator

@cameronperera

I do understand the motivation for this change within the a11y goal in mind.
I am not against the change.

That said, I do think, despite it looks small, the 2 attributes provide different behaviours that can be trivial.

Also, this is an extended pattern in our codebase and this change can disrupt that, no problem with it, but it might need to be spread within the team.

I do think this could be a topic to discuss within Tech time?

Also, feel free to ping me on this topic, I would like to understand better the issue when using disabled within the a11y context

@cameronperera
Copy link
Collaborator Author

@cameronperera

I do understand the motivation for this change within the a11y goal in mind. I am not against the change.

That said, I do think, despite it looks small, the 2 attributes provide different behaviours that can be trivial.

Also, this is an extended pattern in our codebase and this change can disrupt that, no problem with it, but it might need to be spread within the team.

I do think this could be a topic to discuss within Tech time?

Also, feel free to ping me on this topic, I would like to understand better the issue when using disabled within the a11y context

Funny enough I mentioned that in the jira ticket when I did the initial review and I forgot to check my own comment. I add this to the tech time topic list. Until then, I will do some testing in other forms. I know we have some forms that once the value is set, there is no changing it and I think that would be the times we could see issues with the readonly attribute.

@cameronperera cameronperera marked this pull request as draft December 10, 2024 18:07
@cameronperera cameronperera marked this pull request as ready for review December 16, 2024 20:29
Copy link
Collaborator

@lisbet-alvarez lisbet-alvarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this, the screen reader now picks it up!!

@cameronperera cameronperera merged commit fce97fd into main Dec 17, 2024
12 checks passed
@cameronperera cameronperera deleted the ICU-15666-boundary-enterprise-a-11-y-audit-disabled-interactive-element-multiple branch December 17, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants