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: add disabled styling to breadcrumbs component #4783

Closed
wants to merge 7 commits into from

Conversation

esauerbo
Copy link
Contributor

Description of changes

Issue #, if available

#4776

Description of how you validated changes

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • Relevant documentation is changed or added (and PR referenced)
  • yarn test passes and tests are updated/added
  • No side effects or sideEffects field updated

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@esauerbo esauerbo requested a review from a team as a code owner November 27, 2023 17:56
Copy link

changeset-bot bot commented Nov 27, 2023

🦋 Changeset detected

Latest commit: 3fe7a4c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@aws-amplify/ui-react Patch
@aws-amplify/ui Patch
@aws-amplify/ui-react-auth Patch
@aws-amplify/ui-react-liveness Patch
@aws-amplify/ui-react-notifications Patch
@aws-amplify/ui-react-storage Patch
@aws-amplify/ui-react-core-auth Patch
@aws-amplify/ui-react-core-notifications Patch
@aws-amplify/ui-react-core Patch
@aws-amplify/ui-react-native-auth Patch
@aws-amplify/ui-react-native Patch
@aws-amplify/ui-vue Patch
@aws-amplify/ui-angular Patch
@aws-amplify/ui-react-geo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +20 to +26
.amplify-breadcrumbs__link {
background-color: var(
--amplify-components-breadcrumbs__link-disabled-color
);
color: var(--amplify-components-breadcrumbs__link-disabled-color);
pointer-events: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed here? Should be covered by lines 45-51.

Copy link
Contributor Author

@esauerbo esauerbo Nov 28, 2023

Choose a reason for hiding this comment

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

The way it's currently written the link won't be disabled if the item is disabled, so it is necessary, but I think it would make sense to change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually think I misunderstood, so without this you'd need to add isDisabled to Breadcrumsb.Link in addition to Breadcrumsb.Item otherwise the link would still be active.

IMO it makes sense the way it is because you can also create the component like <Breadcrumbs items=... so it might be confusing if you could pass isDisabled in with items in only that case but you'd need to put it in both Link and Item if using Breadcrumbs.Items

Copy link
Contributor

@hbuchel hbuchel left a comment

Choose a reason for hiding this comment

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

Is this a fix or a feature request? I remember having some discussion with @dbanksdesign about the usefulness of adding "disabled" links to Breadcrumbs; namely that they should probably just be a text element not a link with a disabled attribute. Some things to consider:

  • A link with a disabled attribute doesn't disable it the way it does for a button or input, and it doesn't convey any disabled state to assistive tech. If you test a link with a disabled attribute with a screen reader, nothing is announced about it being disabled.
  • Using pointer-events: none in CSS still allows the link to be keyboard operable.

@reesscot
Copy link
Contributor

Is this a fix or a feature request? I remember having some discussion with @dbanksdesign about the usefulness of adding "disabled" links to Breadcrumbs; namely that they should probably just be a text element not a link with a disabled attribute. Some things to consider:

* A link with a disabled attribute doesn't disable it the way it does for a button or input, and it doesn't convey any disabled state to assistive tech. If you [test a link](https://codepen.io/hbuchel/live/bGzxbjK) with a disabled attribute with a screen reader, nothing is announced about it being disabled.

* Using `pointer-events: none` in CSS still allows the link to be keyboard operable.

+1, it's against web standards to disable a link. I think it's better for the customer to just render a text element if they don't want a breadcrumb item clickable.

@esauerbo esauerbo closed this Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants