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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: update popover role to be note when it does not trap focus",
"packageName": "@fluentui/react-popover",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 2 additions & 2 deletions packages/react-components/react-popover/Spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Default popover
</div>

// on document.body
<div role="complementary">
<div role="group">
{/** content */}
</div>
```
Expand Down Expand Up @@ -499,7 +499,7 @@ Accessible markup is divided into two scenarios:
```tsx
// Popover that does not trap focus
<button aria-expanded="false">Trigger</button>
<div role="complementary">
<div role="group">
No focus trap
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mount = (element: JSX.Element) => {
};

const popoverTriggerSelector = '[aria-expanded]';
const popoverContentSelector = '[role="complementary"]';
const popoverContentSelector = '[role="group"]';
const popoverInteractiveContentSelector = '[role="dialog"]';

describe('Popover', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('PopoverSurface', () => {
expect(queryByRole('dialog')).not.toBeNull();
});

it('should set role complementary if focus trap is not active', () => {
it('should set role group if focus trap is not active', () => {
// Arrange
mockPopoverContext({ trapFocus: false });
const { getByTestId } = render(<PopoverSurface {...props}>Content</PopoverSurface>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`PopoverSurface renders a default state 1`] = `
class="fui-PopoverSurface"
data-tabster="{\\"deloser\\":{},\\"modalizer\\":{\\"id\\":\\"modal-1\\",\\"isOthersAccessible\\":true}}"
data-testid="component"
role="complementary"
role="group"
>
Default PopoverSurface
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const usePopoverSurface_unstable = (
},
root: getNativeElementProps('div', {
ref: useMergedRefs(ref, contentRef),
role: trapFocus ? 'dialog' : 'complementary',
role: trapFocus ? 'dialog' : 'group',
'aria-modal': trapFocus ? true : undefined,
...modalAttributes,
...props,
Expand Down