From 1cafabe2e3926a5332f6cc106826cf9b1b8b73b1 Mon Sep 17 00:00:00 2001 From: Aleksandr Shumilov Date: Wed, 6 Nov 2024 16:50:44 +0000 Subject: [PATCH] [FX-NULL] Restore number input behaviour and look (#4619) --- .changeset/fast-shirts-greet.md | 7 +++++++ packages/base/NumberInput/src/NumberInput/NumberInput.tsx | 2 -- .../src/NumberInput/__snapshots__/test.tsx.snap | 2 -- packages/base/NumberInput/src/NumberInput/test.tsx | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .changeset/fast-shirts-greet.md diff --git a/.changeset/fast-shirts-greet.md b/.changeset/fast-shirts-greet.md new file mode 100644 index 0000000000..60c0f5f2b2 --- /dev/null +++ b/.changeset/fast-shirts-greet.md @@ -0,0 +1,7 @@ +--- +'@toptal/picasso-number-input': patch +--- + +### NumberInput + +- do not pass min and max to HTML number input diff --git a/packages/base/NumberInput/src/NumberInput/NumberInput.tsx b/packages/base/NumberInput/src/NumberInput/NumberInput.tsx index 6e7a1aab03..58531a81de 100644 --- a/packages/base/NumberInput/src/NumberInput/NumberInput.tsx +++ b/packages/base/NumberInput/src/NumberInput/NumberInput.tsx @@ -97,8 +97,6 @@ export const NumberInput = forwardRef( inputProps={{ ...rest, step, - min, - max, // TODO: [FX-6102] Add test for wheel event onWheel: enableChangeOnMouseWheel ? undefined diff --git a/packages/base/NumberInput/src/NumberInput/__snapshots__/test.tsx.snap b/packages/base/NumberInput/src/NumberInput/__snapshots__/test.tsx.snap index 90460e0f69..b2f6e20dcb 100644 --- a/packages/base/NumberInput/src/NumberInput/__snapshots__/test.tsx.snap +++ b/packages/base/NumberInput/src/NumberInput/__snapshots__/test.tsx.snap @@ -10,8 +10,6 @@ exports[`NumberInput renders 1`] = ` { expect(container.firstChild).toMatchSnapshot() }) - it('increase value', async () => { + it('increases value by step', async () => { const { getByDisplayValue, queryAllByRole } = renderNumberInput() const input = getByDisplayValue('10') as HTMLInputElement @@ -55,7 +55,7 @@ describe('NumberInput', () => { expect(input.value).toBe('15') }) - it('decrease value', () => { + it('decreases value by step', () => { const { getByDisplayValue, queryAllByRole } = renderNumberInput() const input = getByDisplayValue('10') as HTMLInputElement