Skip to content

Commit

Permalink
fix(input): correctly display decrement arrow (#3722)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSisb committed Jan 18, 2024
1 parent ba0d7bc commit 47c329b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/late-mirrors-rule.md
@@ -0,0 +1,6 @@
---
"@twilio-paste/input": patch
"@twilio-paste/core": patch
---

[Input] Fix rendering logic of decrement arrow on number input
2 changes: 1 addition & 1 deletion packages/paste-core/components/input/src/Input.tsx
Expand Up @@ -245,7 +245,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
const [showDecrement, setShowDecrement] = React.useState(true);

// used for number inputs to be able to track uncontrolled number inputs value being changed by a user and it not being tracked by an applications
const [internalValue, setInternalValue] = React.useState(props.defaultValue ? props.defaultValue : "0");
const [internalValue, setInternalValue] = React.useState(value ?? props.defaultValue ?? "0");

React.useEffect(() => {
if (type !== "number") return;
Expand Down
Expand Up @@ -715,8 +715,8 @@ DefaultNumberInput.storyName = "Number Input - Controlled";

export const TestNumberInput = (): React.ReactNode => {
const uid = useUID();
const [value, setValue] = React.useState("0");
const [minValue, setMinValue] = React.useState("-10");
const [value, setValue] = React.useState("5");
const [minValue, setMinValue] = React.useState("0");
const [maxValue, setMaxValue] = React.useState("10");
const [stepValue, setStepValue] = React.useState("1");
return (
Expand Down

0 comments on commit 47c329b

Please sign in to comment.