fix(breadcrumb): disabled behaviors and styles
Description
Disabled breadcrumbs (except for action buttons) in storybook still had pointer events, hover and focus styles. There was no indication that a text-based breadcrumb was disabled. This was partially because the tabindex was being set to 0, which then was adding specific styles. Additionally, the is-disabled class was not being added to the proper .spectrum-Breadcrumb-itemLink element. This PR should address these a11y concerns and disabled bugs.
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
@jawinn
- [x] Verify that the disabled breadcrumb on the breadcrumb storybook page has no hover/focus styles, and no pointer events. Additionally, the breadcrumb item should be left out of the tab order
- [x] Verify that the parent
.spectrum-Breadcrumbs-itemdoes not have theis-disabledclass - [x] With the project running locally, (
yarn start), find the breadcrumb storybook docs or default page - [x] In
breadcrumb/stories/breadcrumb.stories.js, add an additional disabled breadcrumb item (or feel free to experiment with ones already there). In the browser inspector, verify the following:- [x] when
isDisabled: false, thetabindexof your.spectrum-Breadcrumbs-itemLinkbreadcrumb is0. It should be focusable, clickable, and have a hover state. Theis-disabledclass should not be applied at this point and there should not be adisabledattribute - [x] when
isDisabled: true, thetabindexshould not be defined on that element. It should not be focusable, clickable, or have a hover state. Theis-disabledclass andaria-disabled="true"attribute should be added to.spectrum-Breadcrumbs-itemLink
- [x] when
Regression testing
Validate:
- The documentation pages for at least two other components are still loading, including:
- [x] The pages render correctly, are accessible, and are responsive.
- If components have been modified, VRTs have been run on this branch:
- [ ] VRTs have been run and looked at.
- [ ] Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.
Screenshots
To-do list
- [x] I have read the contribution guidelines.
- [x] I have updated relevant storybook stories and templates.
- [ ] I have tested these changes in Windows High Contrast mode.
- [ ] If my change impacts other components, I have tested to make sure they don't break.
- [ ] If my change impacts documentation, I have updated the documentation accordingly.
- [ ] ✨ This pull request is ready to merge. ✨
🦋 Changeset detected
Latest commit: a01ac075ae227574628f72b4c0fe61f1f53792c5
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @spectrum-css/breadcrumb | 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
🚀 Deployed on https://pr-2886--spectrum-css.netlify.app
File metrics
Summary
Total size: 4.66 MB* Total change (Δ): ⬆ 0.22 KB (0.00%)
Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
| Package | Size | Δ |
|---|---|---|
| breadcrumb | 16.76 KB | ⬆ 0.05 KB |
Details
breadcrumb
| File | Head | Base | Δ |
|---|---|---|---|
| index-base.css | 16.76 KB | 16.71 KB | ⬆ 0.05 KB (0.32%) |
| index-vars.css | 16.76 KB | 16.71 KB | ⬆ 0.05 KB (0.32%) |
| index.css | 16.76 KB | 16.71 KB | ⬆ 0.05 KB (0.32%) |
| metadata.json | 9.78 KB | 9.72 KB | ⬆ 0.06 KB (0.57%) |
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.