ebay-filter-menu-button: aria-pressed incorrectly rendered on menu item selection#716
ebay-filter-menu-button: aria-pressed incorrectly rendered on menu item selection#716ArtBlue wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 8997df6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
There was a problem hiding this comment.
Pull request overview
Fixes an accessibility/markup bug where ebay-filter-menu-button incorrectly rendered aria-pressed (a toggle-button attribute) when menu items were selected, by removing the attribute and switching the “selected” visual styling to a dedicated BEM modifier class.
Changes:
- Remove
aria-pressedfrom the Marko and React implementations and addfilter-menu-button__button--activewhen any item is selected. - Update Skin SCSS and Storybook story markup to use the new active modifier class instead of
[aria-pressed="true"]. - Update React unit tests and add a changeset for package versioning.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/skin/src/sass/filter-menu-button/stories/filter-menu-button.stories.js | Updates the “pressed” story markup to use the active modifier class (no aria-pressed). |
| packages/skin/src/sass/filter-menu-button/filter-menu-button.scss | Switches selected-state styling selectors from [aria-pressed="true"] to .filter-menu-button__button--active. |
| packages/ebayui-core/src/components/ebay-filter-menu-button/index.marko | Removes aria-pressed and conditionally adds the active modifier class when there are checked values. |
| packages/ebayui-core-react/src/ebay-filter-menu-button/filter-menu-button.tsx | Removes aria-pressed and conditionally adds the active modifier class based on hasChecked. |
| packages/ebayui-core-react/src/ebay-filter-menu-button/tests/index.spec.tsx | Updates assertions to check for the active modifier class and absence of aria-pressed. |
| .changeset/fix-filter-menu-button-aria-pressed.md | Adds versioning metadata and notes for the change. |
Comments suppressed due to low confidence (1)
packages/skin/src/sass/filter-menu-button/filter-menu-button.scss:61
- The built CSS in
packages/skin/dist/filter-menu-button/filter-menu-button.cssstill containsaria-pressedselectors, so the published Skin output will likely not reflect this SCSS change unlessdistis regenerated and checked in (e.g., vianpm run build:css). Please regenerate and commit the updateddistartifacts for this module.
button.filter-menu-button__button--active {
@include token-mixins.border-color-token(
filter-button-foreground-color,
color-border-strong
);
|
This isn't a complete solution to the problem. Looks like we already do have a complete solution in skin (see here), but we haven't yet updated Marko or React components. Here is what actually needs to happen:
|
Great catch! |
| a11yFilterAppliedText = "Filter Applied", | ||
| a11yFooterText, | ||
| text, | ||
| count, |
There was a problem hiding this comment.
A few things:
- I don't see types for either of these new inputs, are you sure it passes CI?
- If
hasSelectedis derived from the checked values,countshould be too- If we think there are circumstances where
countcan't be derived, then there are certainly also cases wherehasSelectedcan't be - We need make this opt-in if we want to prevent breaking changes (I assume some users have already added
(+n)to theirinput.text)
- If we think there are circumstances where
| } | ||
|
|
||
| button.filter-menu-button__button[aria-pressed="true"] { | ||
| button.filter-menu-button__button--active { |
There was a problem hiding this comment.
We should probably call this --selected to align with filter-chip--selected
| key="button" | ||
| type="button" | ||
| class="filter-menu-button__button" | ||
| class=["filter-menu-button__button", "filter-chip", hasSelected && "filter-menu-button__button--active", hasSelected && "filter-chip--selected"] |
There was a problem hiding this comment.
Why are we adding filter-chip and filter-chip--selected? I don't think adding chip styles is in-scope for this issue
|
@ArtBlue I made a mistake, it was not a great catch! We had a solution for selected |
ba1b291 to
c714fa9
Compare
PR Preview DeployedWebsite • commit 8997df6 |
Fixes #693
Generated by Local Conductor · QA-validated before push