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

[Unstable_NumberInput]: step incorrect with min #42814

Closed
tonyhallett opened this issue Jul 1, 2024 · 3 comments
Closed

[Unstable_NumberInput]: step incorrect with min #42814

tonyhallett opened this issue Jul 1, 2024 · 3 comments
Assignees
Labels
component: number field This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base

Comments

@tonyhallett
Copy link
Contributor

tonyhallett commented Jul 1, 2024

Steps to reproduce

https://codesandbox.io/s/eager-ully-9yvkfn

Steps:

  1. Press plus button - 3 => 4
  2. Press plus button - 4 => 6

Current behavior

Does not adhere to odd steps

Expected behavior

Should be odd stepped.

See https://developer.mozilla.org/en-US/docs/Web/API/ValidityState/stepMismatch
Given <input type="number" min="20" max="40" step="2" /> - step 2

if (value - min) % 2 !== 0, stepMismatch will be true.

This is not an issue with the alpha version of NumberField mentioned in this issue mui/base-ui#41 (comment)
https://codesandbox.io/p/sandbox/winter-meadow-p9x353

Context

No response

Your environment

System:
OS: Windows 11 10.0.22631
Binaries:
Node: 22.2.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Not Found
Edge: Chromium (126.0.2592.81)
npmPackages:
@emotion/react: ^11.11.4 => 11.11.4
@emotion/styled: ^11.11.5 => 11.11.5
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 5.15.21
@mui/icons-material: ^5.15.20 => 5.15.20
@mui/material: ^5.15.20 => 5.15.21
@mui/private-theming: 5.15.20
@mui/styled-engine: 5.15.14
@mui/system: 5.15.20
@mui/types: 7.2.14
@mui/utils: 5.15.20
@mui/x-charts: ^7.7.1 => 7.7.1
@mui/x-data-grid: ^7.7.1 => 7.7.1
@types/react: ^18.3.3 => 18.3.3
react: ^18.3.1 => 18.3.1
react-dom: ^18.3.1 => 18.3.1
typescript: ^5.4.5 => 5.4.5

Search keywords: Unstable_NumberInput NumberInput

@tonyhallett tonyhallett added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 1, 2024
@aarongarciah aarongarciah added package: base-ui Specific to @mui/base component: number field This is the name of the generic UI component, not the React module! labels Jul 2, 2024
@michaldudak
Copy link
Member

The NumberInput was rewritten in mui/base-ui#186 and is available in a @base_ui/react package.

We support just the new version.

@michaldudak michaldudak closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@zannager zannager removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 3, 2024
@tonyhallett
Copy link
Contributor Author

When will the documentation link to the new component https://mui.com/base-ui/react-number-input/ ?

Base UI's Number Input component is a customizable replacement for the native HTML

The current component is most definitely not a replacement for the native HTML element.

@michaldudak
Copy link
Member

We'll be setting up a new site for the docs of @base_ui/react. The current docs will continue to describe @mui/base for those who already use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: number field This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

No branches or pull requests

4 participants