react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

ComboBox with name property - warnings in console.

Open bhorn opened this issue 1 year ago โ€ข 0 comments

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

bhorn avatar May 04 '24 12:05 bhorn