Skip to content

Commit

Permalink
fix: conditionally adds aria-expanded to dropdown (microsoft#20671)
Browse files Browse the repository at this point in the history
* fix: contitionally adds aria-expanded to dropdown

* chore: remove has popup

* add changelog
  • Loading branch information
chpalac authored and Marion Le Pontois committed Jan 17, 2022
1 parent cff92fc commit ce554d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/fluentui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix color of `Dropdown` checkable indicator on hover in high contrast theme @annabratseiko ([#20621](https://github.com/microsoft/fluentui/pull/20621))
- Fix `Carousel` comoponents to properly pass ref to root slots @chpalac ([#20645](https://github.com/microsoft/fluentui/pull/20645))
- Fix `Card` comoponent to properly pass ref to root slots @chpalac ([#20644](https://github.com/microsoft/fluentui/pull/20644))
- Fix `Dropdown` by conditionally adding `aria-expanded="true"` to the button trigger @chpalac ([#20671](https://github.com/microsoft/fluentui/pull/20671))
- Optimized `felaInvokeKeyframesPlugin` to not create new objects but reuse existing one in `reduce` @mbman ([#20649](https://github.com/microsoft/fluentui/pull/20649))

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export const Dropdown: ComponentWithAs<'div', DropdownProps> &
'aria-invalid': ariaInvalid,
'aria-label': undefined,
'aria-labelledby': [ariaLabelledby, triggerButtonId].filter(l => !!l).join(' '),
...(open && { 'aria-expanded': true }),
});

const { onClick, onFocus, onBlur, onKeyDown, ...restTriggerButtonProps } = triggerButtonProps;
Expand Down

0 comments on commit ce554d7

Please sign in to comment.