Skip to content

Commit

Permalink
fix(numberfield): forward onInput handler
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyaaa committed Dec 12, 2023
1 parent a87d613 commit dad84bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/react/scaffolds/number-field/number-field.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ export interface NumberInputProps {
name?: string;
label?: string;
onChange?: (value: number) => void;
onBlur?: (e?: any) => void;
onFocus?: (e?: any) => void;
onInput?: AriaNumberFieldProps["onInput"];
onBlur?: AriaNumberFieldProps["onBlur"];
onFocus?: AriaNumberFieldProps["onFocus"];
onFocusChange?: (isFocused: boolean) => void;
onKeyDown?: (e?: any) => void;
onKeyUp?: (e?: any) => void;
onKeyDown?: AriaNumberFieldProps["onKeyDown"];
onKeyUp?: AriaNumberFieldProps["onKeyUp"];
// ==== Style props
textAlign?: Sprinkles["textAlign"];
fontSize?: Sprinkles["fontSize"];
Expand Down
3 changes: 3 additions & 0 deletions packages/react/stories/NumberField.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const Primary: Story = {
maxValue={2000}
textAlign="right"
value={value}
onInput={(event) => {
console.log("Input", event.target.value);
}}
onChange={(value) => {
console.log("Change", value);
setValue(value);
Expand Down

0 comments on commit dad84bf

Please sign in to comment.