tbleckert / react-select-search

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

Add empty search message #129

Closed citius closed 3 years ago

citius commented 3 years ago

Add empty message to options list if list is has no items. emptyMessage can be a string or a render function.

This feature is very useful in selector's "search mode"

vercel[bot] commented 3 years ago

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/tbleckert/react-select-search/8818nbrc1
✅ Preview: https://react-select-search-git-master.tbleckert.vercel.app

tbleckert commented 3 years ago

@citius Sorry for the late reply. Great work! Seems to work great. The only thing missing is a class name on the <li>. Like <li className={cls('not-found')}>. And maybe it should always be wrapped in that li, even if you provide your own function? Like the custom renderer for options.

citius commented 3 years ago

@citius Sorry for the late reply. Great work! Seems to work great. The only thing missing is a class name on the <li>. Like <li className={cls('not-found')}>. And maybe it should always be wrapped in that li, even if you provide your own function? Like the custom renderer for options.

Agree. I've patched a code. Please, review.

tbleckert commented 3 years ago

@citius Looks great!