Skip to content

Commit

Permalink
Merge pull request #217 from Hipo/feat/number-input-improvement
Browse files Browse the repository at this point in the history
feat(input/number): Add className `number-input`
  • Loading branch information
jamcry authored Aug 17, 2023
2 parents af4cd8c + 243ab40 commit 5d089c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/form/input/number/NumberInput.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classNames from "classnames";
import React from "react";

import Input from "../Input";
Expand All @@ -17,6 +18,7 @@ const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>((props,
value,
onChange,
inputMode = "decimal",
customClassName,
...rest
} = props;

Expand Down Expand Up @@ -50,7 +52,14 @@ const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>((props,
});

return (
<Input ref={ref} type={"text"} onChange={handleChange} value={finalValue} {...rest} />
<Input
ref={ref}
customClassName={classNames(customClassName, "number-input")}
type={"text"}
onChange={handleChange}
value={finalValue}
{...rest}
/>
);

function handleChange(event: React.SyntheticEvent<HTMLInputElement>) {
Expand Down

0 comments on commit 5d089c5

Please sign in to comment.