Material Select - MutationObserver problem


Topic: Material Select - MutationObserver problem

Backstuber asked 6 years ago

We use material select in our application. One page contains select that changes often based on actions on that page - specifically adding and removing options. Problem is this change gets slower and slower. When I checked the code, it seems like there are some MutationObservers to "refresh" material select every time the DOM is changed, but it seems these MutationObservers are not cleared when we call materialSelect('destroy'). Is there a way to clear them?


Sebastian Kaczmarek staff pro premium answered 6 years ago

Unless you'll edit the source code there is no option to clear them manually.

However, you can add `data-stop-refresh="true"` attribute to the `<select>` element and the Material Select will not use `MutationObservers`. Please remember that this way you will have to refresh the material select manually on each change.

It will be fixed soon


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: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No