Skip to content

Commit

Permalink
feat!: Convert Select from Main into a compound component (#2309)
Browse files Browse the repository at this point in the history
Fixes: #1932

[category:Components]

### BREAKING CHANGES
- We've converted `Select` in Main into a compound component. This component matches our pattern of providing access to lower-level elements and allows for more flexibility. 
- The spacing between menu and its target element will increase from 0px to 4px
- We've also [deprecated](https://canvas.workday.com/getting-started/canvas-glossary#deprecation) the `Select` in Preview. You may still consume this component but suggest migrating over to the one in Main.

Co-authored-by: manuel.carrera <[email protected]>
Co-authored-by: @RayRedGoose <[email protected]>
Co-authored-by: @jamesfan <[email protected]>
  • Loading branch information
4 people authored Oct 20, 2023
1 parent 10b7f1e commit e60a421
Show file tree
Hide file tree
Showing 72 changed files with 2,586 additions and 965 deletions.
2 changes: 1 addition & 1 deletion .storybook/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const routes = {
'/components/inputs/color-input/': 'components-inputs-color-picker-color-input--basic',
'/components/inputs/form-field/': 'components-inputs-form-field--basic',
'/components/inputs/radio/': 'components-inputs-radio--basic',
'/components/inputs/select/': 'preview-select-top-label--default',
'/components/inputs/select/': 'components-inputs-select--basic',
'/components/inputs/switch/': 'components-inputs-switch--basic',
'/components/inputs/text-area/': 'components-inputs-textarea--basic',
'/components/inputs/text-input/': 'components-inputs-text-input--basic',
Expand Down
10 changes: 1 addition & 9 deletions cypress/integration/Autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,13 @@ describe('Autocomplete', () => {
cy.findByRole('combobox').type('{esc}');
});

it('should clear the combobox', () => {
cy.findByRole('combobox').should('have.value', '');
});

it('should close the listbox', () => {
cy.findByRole('listbox').should('not.exist');
});

it('should keep focus on the combobox', () => {
cy.findByRole('combobox').should('have.focus');
});

it('should not show the clear button', () => {
cy.get('[data-testid=clear]').should('not.be.visible');
});
});

context('when the clear button is clicked', () => {
Expand Down Expand Up @@ -332,7 +324,7 @@ describe('Autocomplete', () => {
});
});
});

context('when the user types in a value not found', () => {
beforeEach(() => {
cy.findByRole('combobox').type('Peach');
Expand Down
Loading

0 comments on commit e60a421

Please sign in to comment.