tbleckert / react-select-search

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

renderOption renderValue won't stop re rendering #83

Closed JoueBien closed 3 years ago

JoueBien commented 4 years ago

Un-able to set options and use the custom render options because the options are constantly getting re-drawn. This causes the scroll box force relocate to the top after the scroll event has finished and for for the options to become un-clickable

importing the select field using

import SelectSearch from 'react-select-search/dist/cjs'
JoueBien commented 4 years ago

At the moment the issue looks like it has been introduced after commit e799dcd9104309096c4c2a38bc21e86bfe00703a

You can get around this issue using a manual install of an older build

npm install --save https://github.com/tbleckert/react-select-search.git#e799dcd9104309096c4c2a38bc21e86bfe00703a

#OR

npm i react-select-search@1.0.2 --save 

note at some point in using older builds you may find that value has been changed to selectedOption

tbleckert commented 4 years ago

@JoueBien Which version are you running? v2.x or v1.x?

JoueBien commented 4 years ago

@JoueBien Which version are you running? v2.x or v1.x?

I was running 2.x latest. I've had to drop back to the 1.0.2 build because of this issue.

tbleckert commented 4 years ago

@JoueBien Ok, I'll take a look. Please create a reproducible test case on codesandbox if you have the time.