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

ComboBox with name property - warnings in console. #6327

Open
bhorn opened this issue May 4, 2024 · 0 comments · May be fixed by #6336
Open

ComboBox with name property - warnings in console. #6327

bhorn opened this issue May 4, 2024 · 0 comments · May be fixed by #6336

Comments

@bhorn
Copy link

bhorn commented May 4, 2024

Provide a general summary of the issue here

If you use set a name attribute on a (React Aria) ComboBox, then warnings appear in the console about how the value prop on input should not be null, and later on about changing from uncontrolled to a controlled component.

🤔 Expected Behavior?

No warnings should appear.

😯 Current Behavior

Initially:

Warning: value prop on input should not be null. Consider using an empty string to clear the component or undefined for uncontrolled components.

Then later if you interact with the combo box, such as pick something:

Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components

💁 Possible Solution

No response

🔦 Context

Trying to have an uncontrolled combo box (one of several) which can be used with FormData when submitting.

🖥️ Steps to Reproduce

Example at:
https://codesandbox.io/p/sandbox/romantic-cookies-gtvrqp?file=%2Fsrc%2FApp.js

Version

react-aria-components 1.2.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Win 11 ( 10.0.22631.3447 )

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

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

Successfully merging a pull request may close this issue.

1 participant