Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/fluentui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Remove `rotate(360deg)` from `PopupContent` content styles @yuanboxue-amber ([#24432](https://github.com/microsoft/fluentui/pull/24432))
- Fix `FocusZone` to reset tabindex when focus is outside the zone with prop `shouldResetActiveElementWhenTabFromZone` @yuanboxue-amber ([#24463](https://github.com/microsoft/fluentui/pull/24463))
- Change `useLayoutEffect` in `Dropdown` to `useIsomorphicLayoutEffect` @marwan38 ([#24559](https://github.com/microsoft/fluentui/pull/24559))
- Fix `Popup` trigger attribute being override @chpalac ([#24794](https://github.com/microsoft/fluentui/pull/24794))
- Fix styling mutation when merging themes in `Dropdown` @petrjaros ([#24787](https://github.com/microsoft/fluentui/pull/24787))

### Performance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const popupBehavior: Accessibility<PopupBehaviorProps> = props => {
: undefined;

if (tabbableTriggerProps) {
tabbableTriggerProps['aria-haspopup'] = 'dialog';
tabbableTriggerProps['aria-haspopup'] = props.trigger?.props.hasOwnProperty('aria-haspopup')
Comment thread
chpalac marked this conversation as resolved.
? props.trigger?.props['aria-haspopup']
: 'dialog';

if (process.env.NODE_ENV !== 'production') {
// Override the default trigger's accessibility schema class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ describe('PopupBehavior.ts', () => {
expect(expectedResult.attributes.trigger.tabIndex).toEqual(-1);
});

test('Do not override trigger aria-haspopup attribute', () => {
const expectedResult = popupBehavior({
trigger: <button aria-haspopup={null} />,
tabbableTrigger: true,
});
expect(expectedResult.attributes.trigger['aria-haspopup']).toBeNull();
});

// TODO: Fix me
// test('does not add tabIndex if element is already tabbable', () => {
// const expectedResult = popupBehavior({ trigger: <Button />, tabbableTrigger: true })
Expand Down