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: avoid empty label for a11y compliance #662

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

mas-who
Copy link
Contributor

@mas-who mas-who commented Feb 21, 2024

Done

  • Resolved empty label a11y issue for ip address selector

QA

  1. Run the LXD-UI:
    • On the demo server via the link posted by @webteam-app below. This is only available for PRs created by collaborators of the repo. Ask @mas-who or @edlerd for access.
    • With a local copy of this branch, run as described here.
  2. Perform the following QA steps:
    • Check that the label is not visible for the ip address selector
    • Check wave evaluation tool that no a11y empty label warning is reported when the ip address selector is visible on the page

@webteam-app
Copy link

Demo starting at https://lxd-ui-662.demos.haus

@edlerd
Copy link
Collaborator

edlerd commented Feb 21, 2024

This breaks the layout of the custom radio input:
image

@mas-who
Copy link
Contributor Author

mas-who commented Feb 21, 2024

This breaks the layout of the custom radio input: image

Right, I see the reason is that the labelClassname prop is applied to the label element that wraps the input. I think some custom css will be necessary here, unless if we try making the change upstream again (something like a labelTextClassname prop)?

Screenshot from 2024-02-21 13-09-57

@edlerd
Copy link
Collaborator

edlerd commented Feb 21, 2024

Right, I see the reason is that the labelClassname prop is applied to the label element that wraps the input. I think some custom css will be necessary here, unless if we try making the change upstream again (something like a labelTextClassname prop)?

I think this is a very special use case and justifies introduction of a custom labelClassName, with custom styling in LXD-UI to hide the label-text here.

Signed-off-by: Mason Hu <mason.hu@canonical.com>
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

Perfect, thanks for the fix!

@mas-who mas-who merged commit 0368ad1 into canonical:main Feb 21, 2024
10 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 21, 2024
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.

None yet

3 participants