Select DropDown retaining value in modal


Topic: Select DropDown retaining value in modal

emmdb pro premium priority asked 8 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.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • 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
Tags