react-spectrum
react-spectrum copied to clipboard
ComboBox with name property - warnings in console.
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:
valueprop oninputshould not be null. Consider using an empty string to clear the component orundefinedfor 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