gogoair / react-combo-select

React dropdown for select and multiselect
MIT License
28 stars 9 forks source link

Drop down option not updating correctly #47

Open muthukurukrishnakanth opened 5 years ago

muthukurukrishnakanth commented 5 years ago

Hi Team,

We are facing one issue with dependent drop downs. Please see below scenario.

Scenario:

Filter 1: Airline Filter 2: Technology
option1: AAL option1: ATG, 2KU
option2: ACA option2: 2KU, ATG4

We have 5 dependent dropdown (filters) like Airline, Fleet type, Technology and some other filters.

Let say when we select one option in airline filter (say 'AAL') and it will populate all the available options like ('ATG', '2KU') for the technology filter based on the selected airline and when we select any of the technology option say 2KU and again change the Airline filter to ACA option then the technology filter options are not updating with available technology options for ACA airline (say 2KU, ATG4). And it is happening with all other filters.

We have debugged the root cause of that issue and below code is stopping the re rendering of the drop downs with updated options.

https://github.com/gogoair/react-combo-select/blob/d3e17f72d68c896c06f2816daa3348605be5fbb6/src/Components/ComboSelect.jsx#L125

If we remove this line of code it is working fine.

So, Please look in to this issue.

Max-Z80 commented 5 years ago

I make the same observation here. It would be nice to fix this. As a workaround, I noticed that when the prop 'text' is changed, the component is re-rendered and this takes into account changes of 'data' props.