Skip to content

Conversation

@MarkoOleksiyenko
Copy link
Contributor

Description

Moving the Disabled section into Links and Buttons and fixing the SR for disabled link example

Motivation & Context

List-group non-interactive examples should not be disabled and are ignored by the assistive technology.

I propose to move the Disabled section into the Links and buttons with a precision on how to disable it.

In addition to that the Disabled Link example has to include the href="#" for the SR to properly announce that it is unavailable.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

#40752

@MarkoOleksiyenko
Copy link
Contributor Author

Hello @julien-deramond , I am working on the accessibility in my project and noticed that with list-group there is an issue with SR while reading the disabled link + the disabled on readonly doesn't make sense (saw that it is mentioned in the #40752).

I wonder what do you think about a small rearrangement with disabled state ?

We can also add the note that with disabled attribute you can omit the aria-disabled="true" for elements like buttons.

@mdo mdo added this to v5.3.6 Apr 11, 2025
@github-project-automation github-project-automation bot moved this to To do in v5.3.6 Apr 11, 2025
@mdo
Copy link
Member

mdo commented Apr 11, 2025

@julien-deramond I think this makes sense, I'm fine to consolidate the docs here. Also /cc @patrickhlauke for quick eyes.


Use `<a>`s or `<button>`s to create _actionable_ list group items with hover, disabled, and active states by adding `.list-group-item-action`. We separate these pseudo-classes to ensure list groups made of non-interactive elements (like `<li>`s or `<div>`s) don't provide a click or tap affordance.

Add `.disabled` to a `.list-group-item` to make it _appear_ disabled and `aria-disabled="true"` to inform the assistive technology that the element is disabled.
Copy link
Member

Choose a reason for hiding this comment

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

this would then be a good place to reintroduce the will also require custom JavaScript to fully disable their click events... that was removed

Copy link
Member

Choose a reason for hiding this comment

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

and can preface this with "for links, ...". then do a separate paragraph for buttons, with the actual disabled attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fully agree with the links ! For the buttons there is a paragraph just after the link example, probably it is more fitting to keep it there to have the natural flow of context. What do you think?

@julien-deramond julien-deramond moved this from To do to Review in progress in v5.3.6 Apr 15, 2025
mdo added a commit that referenced this pull request Apr 22, 2025
@mdo mdo closed this Apr 22, 2025
@github-project-automation github-project-automation bot moved this from Review in progress to Done in v5.3.6 Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants