Topic: MaterialSelect performance issue
Expected behavior
No performance issue (ie. no freeze) while clicking on the select to open the options.
Actual behavior
Currently we have performance issues when we use two MaterialSelect in cascade. When we select an option in the first select, it replaces the items in the second select. By doing this manipulation several times (without modifying the second select), the browser begins to slow down and may block. You will find a code snippet bellow.
Resources (screenshots, code snippets etc.)
To use this code snippet, just select different options in the first MaterialSelect. Don't select anything in the second select. https://mdbootstrap.com/snippets/jquery/lemaire/2455382?action=forum_snippet#html-tab-view
Jorge Nuñez Malledo answered 4 years ago
I have the same issue. It seems that if you don't select anything from select after init process, some option manipulations from JQuery code will eventually freeze the browser tab.
I Have two questions regarding to this
- When is the next release intended to be published?
- Is there any way we can artificially "force" an option selection to workaround this in the mean time? I've tried to select an option, trigger changes, restart mdb... with no results
Tomek Makowski staff commented 4 years ago
- We don't know when exactly will be next release
- What do you mean exactly?
Grzegorz Bujański staff answered 4 years ago
Hi.
We will fix it as soon as possible. For now, to prevent this error, do this: add to selectTwo
data-stop-refresh='true'
and selectTwo.materialSelect();
to the code of the on change event.
Here you will find a fixed snippet that no longer crashes the browser: https://mdbootstrap.com/snippets/jquery/grzegorz-bujanski/2617166
I hope this will fix your problem until we release a fix.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.19.1
- Device: Any
- Browser: Firefox, Chrome, Edge
- OS: Any
- Provided sample code: No
- Provided link: Yes
Tomek Makowski staff commented 4 years ago
Hi, it looks like a bug with our package. We will try to fix it in next release
Regards
Lemaire commented 4 years ago
Hi, do you plan to fix this bug soon ? We need a fix or, at least, a workaround.
Regards