Destroy/Remove selects
See original GitHub issueWhile developing a Single page application, I noticed there is no way to remove, or destroy a material select. I can remove the select
tag, but the ul
created for styling is not removed, and I couldn’t find any way to remove it with the jQuery library provided. This can become a problem as the user navigates through the application and the DOM elements don’t get removed, resulting in a memory leak.
The best way to do it is adding a overload to $.fn.material_select()
, passing an argument to destroy the select. So it would be something like
$('#myselect').material_select('destroy');
Another way would be with an jQuery event, kind of like angularjs does:
$('#myselect').trigger('$destroy'); //angularjs uses the $destroy event before removing directives.
After a quick look at your code, I think I can implement either for you. Just tell me what of the options you want and I’ll fork it and implement it.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:19 (6 by maintainers)
I’m done with this junk framework…
Please keep in mind that this framework is still in beta.