Skip to content

Commit

Permalink
fix(Select): add [type="button"] to control node (#762)
Browse files Browse the repository at this point in the history
Co-authored-by: yymoroz3 <[email protected]>
  • Loading branch information
neeeekto and yymoroz3 authored Jun 23, 2023
1 parent c113920 commit adc01f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Select/__tests__/Select.base-actions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ describe('Select base actions', () => {
expect(selectControl).not.toHaveClass(SELECT_CONTROL_OPEN_CLASS);
expect(screen.queryByTestId(SelectQa.POPUP)).toBeNull();
});
test('should have [type="button"] attribute in root button', async () => {
await act(async () => {
setup();
});
const selectControl = screen.getByTestId(TEST_QA);
expect(selectControl).toHaveAttribute('type', 'button');
});
});

describe('open', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const SelectControl = React.forwardRef<HTMLElement, ControlProps>((props,
disabled={disabled}
onClick={toggleOpen}
onKeyDown={onKeyDown}
type="button"
>
{label && <span className={selectControlBlock('label')}>{label}</span>}
{showPlaceholder && (
Expand Down

0 comments on commit adc01f0

Please sign in to comment.