Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TagPicker): add aria-disabled to expand button when disabled #33530

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@
{
smhigley marked this conversation as resolved.
Show resolved Hide resolved
"type": "patch",
"comment": "fix: add aria-disabled to expand button when disabled",
"packageName": "@fluentui/react-tag-picker",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,18 @@ describe('TagPicker', () => {
const expandButton = getByRole('button');
expect(expandButton.getAttribute('aria-labelledby')).toContain('Selected Employees');
});

it('sets expand button to disabled when TagPicker is disabled', () => {
const { getByRole } = render(
<TagPicker disabled>
<TagPickerControl>
<TagPickerInput />
</TagPickerControl>
<TagPickerList />
</TagPicker>,
);

const expandButton = getByRole('button');
expect(expandButton.getAttribute('aria-disabled')).toEqual('true');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const useTagPickerControl_unstable = (
renderByDefault: !noPopover,
defaultProps: {
'aria-expanded': open,
'aria-disabled': disabled ? 'true' : undefined,
children: <ChevronDownRegular />,
role: 'button',
},
Expand Down
Loading