Closed helenmak closed 5 years ago
I've tested this, but unfortunately issue like #181 remain. I update props to my render() inside which is a <ModalDropdown>
component, props which are passed to defaultValue and defaultIndex. Even though I see the props update, the rendered <ModalDropdown>
doesn't change.
I also tried updating what's selected by something like this.refs.SearchTypeDropdown.select(dropdownIndex)
, it won't update what's rendered either, even though I see internal state of ModalDropdown
is changed.
@fungilation I have just checked it again, and it works as expected. Can you provide an example of your code?
I'm still having this issue. Workarounds?
This is still an issue. Component doesn't update on change of props, no ComponentDidUpdate in source code. Please re-check
+1 @fungilation
@sohobloo This PR will resolves issues like #181. As you wrote, "If the displayed value is one of the options of the dropdown, you can call select(idx) of your dropdown reference. If not, you have to give a defaultValue and select(-1)".
After this changes, there will be no need to do things like manually call select(id) in order to set a default Value to dropdown.