Skip to content

Commit

Permalink
Add inputRef prop to EuiFieldNumber and allow callbacks in select inp…
Browse files Browse the repository at this point in the history
…utRef
  • Loading branch information
Bargs committed Jan 14, 2019
1 parent 79b8fd7 commit 94a572e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/form/field_number/field_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const EuiFieldNumber = ({
compressed,
prepend,
append,
inputRef,
...rest
}) => {
const classes = classNames('euiFieldNumber', className, {
Expand Down Expand Up @@ -54,6 +55,7 @@ export const EuiFieldNumber = ({
value={value}
placeholder={placeholder}
className={classes}
ref={inputRef}
{...rest}
/>
</EuiValidatableControl>
Expand Down
1 change: 1 addition & 0 deletions src/components/form/field_number/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ declare module '@elastic/eui' {
compressed?: boolean;
prepend?: ReactNode | ReactNode[];
append?: ReactNode | ReactNode[];
inputRef?: (element: HTMLInputElement) => void;
}

export const EuiFieldNumber: SFC<
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare module '@elastic/eui' {
fullWidth?: boolean;
isLoading?: boolean;
hasNoInitialSelection?: boolean;
inputRef?: Ref<HTMLSelectElement>;
inputRef?: Ref<HTMLSelectElement> | ((ref: HTMLInputElement) => void);
compressed?: boolean;
prepend?: ReactNode | ReactNode[];
append?: ReactNode | ReactNode[];
Expand Down

0 comments on commit 94a572e

Please sign in to comment.