Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiFieldNumber should allow step attribute with "any" value #3550

Closed
darnautov opened this issue Jun 4, 2020 · 5 comments · Fixed by #3562
Closed

EuiFieldNumber should allow step attribute with "any" value #3550

darnautov opened this issue Jun 4, 2020 · 5 comments · Fixed by #3562

Comments

@darnautov
Copy link

darnautov commented Jun 4, 2020

Kibana: master
EUI: 23.3.1

According to the <input type="number"> specification step attribute supports "any" as a valid value. At the moment EuiFieldNumber accepts step prop of type number only. Besides TS complaining about the prop type, I also get warning in console Warning: Failed prop type: Invalid prop "step" of type "string" supplied to "EuiFieldNumber", expected "number".

@darnautov darnautov added the bug label Jun 4, 2020
@cchaos
Copy link
Contributor

cchaos commented Jun 4, 2020

Action: allow the string 'any' as an option to the step prop of EuiFieldNumber

@shrey
Copy link
Contributor

shrey commented Jun 4, 2020

Hey, I'd like to work on this issue

@chandlerprall
Copy link
Contributor

Go for it!

@shrey
Copy link
Contributor

shrey commented Jun 4, 2020

@chandlerprall @cchaos Is this okay?

export type EuiFieldNumberProps = InputHTMLAttributes<HTMLInputElement> &
  CommonProps & {
    icon?: IconType;
    isInvalid?: boolean;
    fullWidth?: boolean;
    isLoading?: boolean;
    readOnly?: boolean;
    min?: number;
    max?: number;
    step?: number | 'any';
    inputRef?: Ref<HTMLInputElement>;

@cchaos
Copy link
Contributor

cchaos commented Jun 4, 2020

Yes, that looks great. Go ahead and create a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants