From b3868a1c174d9567b4d1638089ea5ab5f941f252 Mon Sep 17 00:00:00 2001 From: George Aidonidis Date: Thu, 14 Nov 2024 10:38:38 +0200 Subject: [PATCH] [BILL-5689] Display reset button on root hover for Input component (#4622) * Display reset button on root hover * Add changeset * Update snapshots * Add cypress test --- .changeset/hip-pandas-bow.md | 19 +++++++++++++++++++ cypress/component/Input.spec.tsx | 17 +++++++++++++++++ package.json | 1 - .../Autocomplete/__snapshots__/test.tsx.snap | 2 +- .../DatePicker/__snapshots__/test.tsx.snap | 2 +- .../MonthSelect/__snapshots__/test.tsx.snap | 2 +- .../YearSelect/__snapshots__/test.tsx.snap | 2 +- .../src/FormError/__snapshots__/test.tsx.snap | 2 +- .../src/Input/__snapshots__/test.tsx.snap | 14 +++++++------- .../NumberInput/__snapshots__/test.tsx.snap | 2 +- .../src/OutlinedInput/OutlinedInput.tsx | 2 +- .../src/OutlinedInput/stylesRoot.ts | 2 +- .../__snapshots__/test.tsx.snap | 2 +- .../NativeSelect/__snapshots__/test.tsx.snap | 4 ++-- .../__snapshots__/test.tsx.snap | 2 +- .../TagSelector/__snapshots__/test.tsx.snap | 6 +++--- .../__snapshots__/test.tsx.snap | 2 +- .../TimePicker/__snapshots__/test.tsx.snap | 2 +- .../src/Form/__snapshots__/test.tsx.snap | 4 ++-- 19 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 .changeset/hip-pandas-bow.md diff --git a/.changeset/hip-pandas-bow.md b/.changeset/hip-pandas-bow.md new file mode 100644 index 0000000000..2455272fb2 --- /dev/null +++ b/.changeset/hip-pandas-bow.md @@ -0,0 +1,19 @@ +--- +'@toptal/picasso-outlined-input': patch +'@toptal/picasso-select': patch +'@toptal/picasso-input': patch +--- + +--- + +### Input + +- display reset button on hover of full width of the input + +### Select + +- implicit update from input + +### Autocomplete + +- implicit update from input diff --git a/cypress/component/Input.spec.tsx b/cypress/component/Input.spec.tsx index 1ede239533..7c4bf3d39d 100644 --- a/cypress/component/Input.spec.tsx +++ b/cypress/component/Input.spec.tsx @@ -45,4 +45,21 @@ describe('Input', () => { variant: 'error-status/after-focused', }) }) + + it('shows the `X` when hover over the input', () => { + cy.mount( + + + + ) + + cy.getByTestId('reset-button').should('not.be.visible') + // making sure that we hover over the very end of the input not just the text of the input + cy.getByTestId('reset-button').realHover() + cy.getByTestId('reset-button').should('be.visible') + }) }) diff --git a/package.json b/package.json index 7823c5985a..b173bf1de7 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,6 @@ "webpack": "^5.0.0", "yaml": "2", "micromatch": "^4.0.8" - }, "devDependencies": { "@actions/core": "^1.10.0", diff --git a/packages/base/Autocomplete/src/Autocomplete/__snapshots__/test.tsx.snap b/packages/base/Autocomplete/src/Autocomplete/__snapshots__/test.tsx.snap index b9a6a3376b..d7efe8931b 100644 --- a/packages/base/Autocomplete/src/Autocomplete/__snapshots__/test.tsx.snap +++ b/packages/base/Autocomplete/src/Autocomplete/__snapshots__/test.tsx.snap @@ -239,7 +239,7 @@ exports[`Autocomplete static behavior renders 1`] = ` class="flex" >