Skip to content

Commit

Permalink
fix: Remove aria-expanded from date range picker trigger (#3259)
Browse files Browse the repository at this point in the history
  • Loading branch information
avinashbot authored Feb 6, 2025
1 parent 5779bdd commit e8274c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/date-range-picker/__tests__/date-range-picker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ describe('Date range picker', () => {
i18nStrings.modeSelectionLabel
);
});

test('does not have aria-expanded', () => {
const { wrapper } = renderDateRangePicker();
expect(wrapper.findTrigger().getElement()).not.toHaveAttribute('aria-expanded');
wrapper.openDropdown();
expect(wrapper.findDropdown()!.getElement()).not.toHaveAttribute('aria-expanded');
});
});

test('opens relative range mode by default', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/components/button-trigger/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface ButtonTriggerProps extends BaseComponentProps {
const ButtonTrigger = (
{
children,
pressed = false,
pressed,
hideCaret = false,
disabled = false,
readOnly = false,
Expand Down
2 changes: 1 addition & 1 deletion src/select/parts/trigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const Trigger = React.forwardRef(
{...triggerProps}
id={id}
ref={mergedRef}
pressed={isOpen}
pressed={!!isOpen}
disabled={disabled}
readOnly={readOnly}
invalid={invalid}
Expand Down

0 comments on commit e8274c3

Please sign in to comment.