Skip to content

Commit a64bea2

Browse files
committed
expose formatOptions in NumberInput
1 parent e8f7645 commit a64bea2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/bento-design-system/src/NumberField/NumberInput.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ type Props = AtLeast<Pick<HTMLAttributes<HTMLInputElement>, "aria-label" | "aria
1616
BaseNumberProps & {
1717
validationState: "valid" | "invalid";
1818
} & FormatProps &
19-
Pick<NumberFieldStateOptions, "minValue" | "maxValue" | "step">;
19+
Pick<NumberFieldStateOptions, "minValue" | "maxValue" | "step" | "formatOptions">;
2020

2121
export function NumberInput(props: Props) {
2222
const { locale } = useLocale();
23-
const formatOptions = useFormatOptions(props);
23+
const defaultFormatOptions = useFormatOptions(props);
24+
const formatOptions = props.formatOptions ?? defaultFormatOptions;
2425
const state = useNumberFieldState({ ...props, locale, formatOptions });
2526
const inputRef = useRef<HTMLInputElement>(null);
2627

0 commit comments

Comments
 (0)