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

No min, max, or step in MaterialUI UpDown component #2022

Closed
matthias-ccri opened this issue Aug 28, 2020 · 3 comments
Closed

No min, max, or step in MaterialUI UpDown component #2022

matthias-ccri opened this issue Aug 28, 2020 · 3 comments

Comments

@matthias-ccri
Copy link

Description

The library has support for setting the input[type=number] min, max, and step attributes via minimum, maximum, multipleOf. From the Widgets page:

If JSON Schema's minimum, maximum and multipleOf values are defined, the min, max and step input attributes values will take those values.

I'm seeing that the 'updown' widget does not support these attributes.

Codesandbox

Expected behavior

The UpDown input should step by 3, and bound at 1 and 10.

Actual behavior

The UpDown input steps by 1, and does not bound at any min or max.

Version

2.3.0

@zmagauina-fn
Copy link
Contributor

zmagauina-fn commented Nov 12, 2020

I'm having a problem with this too. The fix for this is pretty simple and I'm happy to do it.
The changes would look very similar to this PR, but for Material UI you need to put the stepProps value as generated from that PR into the inputProps property of the Material UI Input component:

<Input
        id={id}
        autoFocus={autofocus}
        required={required}
        type="number"
        disabled={disabled || readonly}
        value={value ? value : ''}
        onChange={_onChange}
        onBlur={_onBlur}
        onFocus={_onFocus}
        inputProps={stepProps}
/>

@epicfaace

@stale
Copy link

stale bot commented Aug 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

@stale stale bot added the wontfix label Aug 14, 2022
@heath-freenome
Copy link
Member

Fixed in v5 beta

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

No branches or pull requests

3 participants