Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MP-345] Restore number input behaviour and look #4619

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading