You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time I select a CLIENT, the items (represented for data props) inside the component should update based on my CLIENT choice. This works well, however the selected value remains with the old one.
Here is my code inside InputPicker custom component:
The prop selectedValue is always passed with the correct value. To "flush" the value of second Picker I added a dummy item inside my items with Id equals 0. Next I called the function pickerInputHandler when onSelected is called, as show:
const pickerInputHandler = (value, type) => {
switch (type) {
case projectTypes.CLIENT:
setClient(value);
setProject(0);
// more code
Why the selected value is not updating in the second PickerModal when I change the outer state and pass the value as props?
The text was updated successfully, but these errors were encountered:
I believe I have a problem when I use two or more PickerModal components. I have a Picker wich items depends on selecting values from another Picker.
I wrapped PickerModal inside a custom component called InputPicker:
Every time I select a CLIENT, the items (represented for data props) inside the component should update based on my CLIENT choice. This works well, however the selected value remains with the old one.
Here is my code inside InputPicker custom component:
The prop selectedValue is always passed with the correct value. To "flush" the value of second Picker I added a dummy item inside my items with Id equals 0. Next I called the function pickerInputHandler when onSelected is called, as show:
Why the selected value is not updating in the second PickerModal when I change the outer state and pass the value as props?
The text was updated successfully, but these errors were encountered: