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

Improve the inputs help prop documentation #63692

Closed
2 tasks done
afercia opened this issue Jul 18, 2024 · 0 comments · Fixed by #63693
Closed
2 tasks done

Improve the inputs help prop documentation #63692

afercia opened this issue Jul 18, 2024 · 0 comments · Fixed by #63693
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Developer Documentation Documentation for developers

Comments

@afercia
Copy link
Contributor

afercia commented Jul 18, 2024

Description

Splitting this out from #61196 / #63669

Most (all?) of the input controls that extend the input base component accept a help prop. This prop is then used to automatically generate an element containg a description that is then associated via an aria-describedby attribute to the input. So far so good.

However, it appears the expected usage of this prop isn't that clear to contributors. For example, in the PostURL component the help prop is being passed an External link component that renders a full link with the additional text '(opens in a new tab)'. That's arguably a meaningful description for the input field to edit the post slug.

For example, that input field is exposed to assistive technologies this way:

  • accessible name: Link
  • accessible description: http://mydomain.org/my-awesome-and-long-post-slug/ (opens in a new tab)

I'm guessing this External link has been used as the help prop only for visual purposes, to place the link below the input. That's less than ideal.

The help prop should be used for:

  • either a meaningful description of the input
  • or for instructions about what to input

As a developer, when hovering the help prop in my editor, I do get a popup with the help prop documentation. Apparently, this isn't sufficient to help contributors fully understand the correct usage of this prop. Screenshot:

Screenshot 2024-07-18 at 08 52 42

I would like to propose to update this prop documentation and clearly explain it must be used only for meaningful descriptions or instructions.

See the base control:

Step-by-step reproduction instructions

N/A

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@afercia afercia added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Jul 18, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant