diff --git a/packages/fluentui/CHANGELOG.md b/packages/fluentui/CHANGELOG.md index e74a4e16beb1ca..2bda8c3131e1e5 100644 --- a/packages/fluentui/CHANGELOG.md +++ b/packages/fluentui/CHANGELOG.md @@ -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 diff --git a/packages/fluentui/accessibility/src/behaviors/Popup/popupBehavior.ts b/packages/fluentui/accessibility/src/behaviors/Popup/popupBehavior.ts index b2a51ea697af97..451993bae6c3ed 100644 --- a/packages/fluentui/accessibility/src/behaviors/Popup/popupBehavior.ts +++ b/packages/fluentui/accessibility/src/behaviors/Popup/popupBehavior.ts @@ -10,7 +10,9 @@ export const popupBehavior: Accessibility = props => { : undefined; if (tabbableTriggerProps) { - tabbableTriggerProps['aria-haspopup'] = 'dialog'; + tabbableTriggerProps['aria-haspopup'] = props.trigger?.props.hasOwnProperty('aria-haspopup') + ? props.trigger?.props['aria-haspopup'] + : 'dialog'; if (process.env.NODE_ENV !== 'production') { // Override the default trigger's accessibility schema class. diff --git a/packages/fluentui/accessibility/test/behaviors/popupBehavior-test.tsx b/packages/fluentui/accessibility/test/behaviors/popupBehavior-test.tsx index 3beb60db437179..147f6d43eff201 100644 --- a/packages/fluentui/accessibility/test/behaviors/popupBehavior-test.tsx +++ b/packages/fluentui/accessibility/test/behaviors/popupBehavior-test.tsx @@ -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: