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

fix(input): correctly display decrement arrow #3722

Merged
merged 1 commit into from Jan 18, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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