Topic: Select DropDown retaining value in modal
emmdb priority asked 7 months ago
when opening select dropdown in modal select a value and close a modal and again open modal for other element it should not retains previous selected value even as state is updated.
when opening select dropdown in modal select a value and close a modal and again open modal for other element it retains previous selected value even as state is updated to reset.
Mateusz Lazaru staff answered 7 months ago
If you're using select with controlled value, you would need to change the state of the value whenever Modal closes. To achieve it, use Modal's onClose
prop, and a proper callback function in toggle buttons if you have any.
If you need more help, share your code here.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB React
- MDB Version: MDB5 7.2.0
- Device: Laptop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No