Skip to content

Commit

Permalink
[FX-NULL] Restore number input behaviour and look (#4619)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashuk authored Nov 6, 2024
1 parent 8dcf27a commit 1cafabe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .changeset/fast-shirts-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@toptal/picasso-number-input': patch
---

### NumberInput

- do not pass min and max to HTML number input
2 changes: 0 additions & 2 deletions packages/base/NumberInput/src/NumberInput/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ export const NumberInput = forwardRef<HTMLInputElement, Props>(
inputProps={{
...rest,
step,
min,
max,
// TODO: [FX-6102] Add test for wheel event
onWheel: enableChangeOnMouseWheel
? undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ exports[`NumberInput renders 1`] = `
<input
aria-invalid="false"
class="base-Input [&::-webkit-calendar-picker-indicator]:bg bg-transparent border-none box-border cursor-[inherit] h-full outline-none p-0 peer resize-none w-full text-md leading-4 text-black [&::placeholder]:text-gray [&::placeholder]:opacity-100 [&::-webkit-outer-spin-button]:appearance [&::-webkit-outer-spin-button]:m [&::-webkit-inner-spin-button]:appearance [&::-webkit-inner-spin-button]:m [-moz"
max="100"
min="-100"
step="5"
type="number"
value="10"
Expand Down
4 changes: 2 additions & 2 deletions packages/base/NumberInput/src/NumberInput/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('NumberInput', () => {
expect(container.firstChild).toMatchSnapshot()
})

it('increase value', async () => {
it('increases value by step', async () => {
const { getByDisplayValue, queryAllByRole } = renderNumberInput()

const input = getByDisplayValue('10') as HTMLInputElement
Expand All @@ -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
Expand Down

0 comments on commit 1cafabe

Please sign in to comment.