mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix(number-input): only allow number type (#5368)
* refactor(number-input): avoid non number type passing to number input * chore(changeset): add changeset
This commit is contained in:
parent
f1abe161b1
commit
ad807bec7e
5
.changeset/stupid-shrimps-divide.md
Normal file
5
.changeset/stupid-shrimps-divide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@heroui/number-input": patch
|
||||
---
|
||||
|
||||
avoid non number type passing to NumberInput
|
||||
@ -5,7 +5,9 @@ import {forwardRef} from "@heroui/system";
|
||||
import {UseNumberInputProps, useNumberInput} from "./use-number-input";
|
||||
import NumberInputStepper from "./number-input-stepper";
|
||||
|
||||
export interface NumberInputProps extends UseNumberInputProps {}
|
||||
export interface NumberInputProps extends Omit<UseNumberInputProps, "type"> {
|
||||
type?: "number";
|
||||
}
|
||||
|
||||
const NumberInput = forwardRef<"input", NumberInputProps>((props, ref) => {
|
||||
const {
|
||||
|
||||
@ -99,6 +99,7 @@ export function useNumberInput(originalProps: UseNumberInputProps) {
|
||||
const {
|
||||
ref,
|
||||
as,
|
||||
type,
|
||||
label,
|
||||
baseRef,
|
||||
wrapperRef,
|
||||
@ -539,6 +540,7 @@ export function useNumberInput(originalProps: UseNumberInputProps) {
|
||||
return {
|
||||
Component,
|
||||
classNames,
|
||||
type,
|
||||
domRef,
|
||||
label,
|
||||
description,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user