Topic: MaterialSelect Search on IE 11
Thomas Emmanuel asked 6 years ago
*Expected behavior*Material Select search should search though all the ul li items
*Actual behavior*On search it gives an error "SCRIPT438: Object doesn't support property or method 'includes - mdb.min.js (9750,63)'"
n.find("li span.filtrable").each(function () {
var e = t(this);
"string" == typeof this.outerHTML &&(this.textContent.toLowerCase().includes(o.toLowerCase()) ? e.show().parent().show() : e.hide().parent().hide())
})
Resources (screenshots, code snippets etc.)
Piotr Glejzer staff answered 6 years ago
We do not fully support IE. But if you will change :
(this.textContent.toLowerCase().includes(o.toLowerCase()) ? e.show().parent().show() : hide().parent().hide())
to
(this.textContent.toLowerCase().indexOf(o.toLowerCase() > -1) ? e.show().parent().show() : hide().parent().hide())
It should work.
Thomas Emmanuel commented 6 years ago
Thanks for the response.
I tried changing 'includes' to 'indexOf'. It doesn't give me an error but the search doesn't work. Doesn't work in ie/firefox/chrome also.
Any other work around?
Regards Prashanth
Thomas Emmanuel commented 6 years ago
Issue is solved.
indexOf(element) !== -1
This helped me.
Thanks
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.8.0
- Device: Lenovo
- Browser: ie 11
- OS: Windows
- Provided sample code: No
- Provided link: No