You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting an IcTextField's value to 'undefined' throws an error in the console. We want to set the value of our input against a prop (that may or may not be there) of a map, but when the prop isn't there an error is thrown from the component due to its value being undefined.
Checking the type for the text field's value field says that it's optional, so I'd expect it to allow for undefined values.
🪜 How to reproduce
Add a text field to your page, e.g. <IcTextField name={'test'} label={'test'} value={undefined} />
Check the console:
🖥 📱 Device
Type: Desktop
Device: MacBook Pro
OS version: macOS Sequoia
Browser version: Safari 18.1 (but any browser)
🧐 Expected behaviour
I'd expect undefined to be a valid value for the 'value' property of an IcTextField, and for it to not throw an error in the console.
Additional info
Unsure if this impacts other form components.
The text was updated successfully, but these errors were encountered:
A PR would be great. I can fix this, but it's a good first issue. Just do the same changes as in this PR #2182 to check if the textfield prop is undefined. If it is, assign it an empty string
Summary of the bug
Setting an IcTextField's value to 'undefined' throws an error in the console. We want to set the value of our input against a prop (that may or may not be there) of a map, but when the prop isn't there an error is thrown from the component due to its value being undefined.
Checking the type for the text field's value field says that it's optional, so I'd expect it to allow for undefined values.
🪜 How to reproduce
<IcTextField name={'test'} label={'test'} value={undefined} />
🖥 📱 Device
🧐 Expected behaviour
I'd expect undefined to be a valid value for the 'value' property of an IcTextField, and for it to not throw an error in the console.
Additional info
Unsure if this impacts other form components.
The text was updated successfully, but these errors were encountered: