tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
676 stars 149 forks source link

SelectSearch - Input value not resetting when loosing focus with renderValue #151

Open yageorge opened 3 years ago

yageorge commented 3 years ago

Hi!

The package works great, but when I am using renderValue, using the example function your docs provided below. The value I add inside the input search bar 'does not reset to empty' when I click outside, I tried onBlur but it did not work as well.

Can you assist me solve this out? All I need from renderValue is just to modify the UI design className for the search bar. nothing else. Using ReactJS + Tailwind.

Thank you! Great job

function renderFontValue(valueProps, snapshot, className) { const { value } = snapshot; const style = { fontFamily: (value && 'stack' in value) ? value.stack : null, }; return ( <input {...valueProps} className={className} style={style} value={snapshot.displayValue} /> ); }