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

[useNumberInput] Warn when switching between controlled and uncontrolled state #38514

Closed
mj12albert opened this issue Aug 17, 2023 · 0 comments · Fixed by #40206
Closed

[useNumberInput] Warn when switching between controlled and uncontrolled state #38514

mj12albert opened this issue Aug 17, 2023 · 0 comments · Fixed by #40206
Assignees
Labels
component: number field This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature package: base-ui Specific to @mui/base

Comments

@mj12albert
Copy link
Member

mj12albert commented Aug 17, 2023

Problem

Suggested in #36119 (comment). There is no warning when changing control mode. Using useControlled would solve this.

Solution

Using useControllableReducer to handle the internal state will make a better foundation for other features e.g. floating point support.

@mj12albert mj12albert 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 Aug 17, 2023
@mj12albert mj12albert self-assigned this Aug 17, 2023
@mj12albert mj12albert moved this to Next in queue in Joy UI Aug 17, 2023
@mj12albert mj12albert moved this from Backlog to In progress now in Joy UI Sep 1, 2023
@oliviertassinari oliviertassinari changed the title [base-ui][useNumberInput] Implement useControllableReducer [base-ui][useNumberInput] Warn when switching between controlled and uncontrolled state Oct 2, 2023
@oliviertassinari oliviertassinari added the enhancement This is not a bug, nor a new feature label Oct 2, 2023
@oliviertassinari oliviertassinari changed the title [base-ui][useNumberInput] Warn when switching between controlled and uncontrolled state [useNumberInput] Warn when switching between controlled and uncontrolled state Oct 2, 2023
@github-project-automation github-project-automation bot moved this from In progress now to Recently completed in Joy UI Feb 5, 2024
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! enhancement This is not a bug, nor a new feature package: base-ui Specific to @mui/base
Projects
Status: Recently completed
2 participants