select icon indicating copy to clipboard operation
select copied to clipboard

fix: null initialValue breaks when labelInValue is set

Open ttys026 opened this issue 4 years ago • 3 comments

fix: null initialValue breaks when labelInValue is set

ttys026 avatar Jul 28 '20 08:07 ttys026

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/select/boe295pmg ✅ Preview: https://select-git-fork-tli4-fix-labelinvalue-break.react-component.vercel.app

vercel[bot] avatar Jul 28 '20 08:07 vercel[bot]

what if value = ''

07akioni avatar Jul 30 '20 03:07 07akioni

what if value = ''

this is executed only if labelInValue is set. It tries to spread key and value out of the array item, which is an object(or null in this case). If you pass a value equals to empty string or any other string, It will panic.

Actually this is a typical error when you try set a string value for a labelInValue Select. We can also give better hint on why this breaks the code.

ttys026 avatar Aug 10 '20 09:08 ttys026