Closed jcorporation closed 2 years ago
The BSN.Component.getInstance
haven't changed in v4.2, you only need to make sure to always get instance of a real HTMLElement object, your first line should work:
console.log(BSN.Dropdown.getInstance(document.getElementById('volumeMenu'))); // returns the instance
Thanks for clarification. The second line works in v4.1 too.
The documentation describes the second line or I misunderstand something?
// reference the initialization
var myDropdownInit = BSN.Dropdown.getInstance('#myDropdown');
The original library does this while we do this which is pretty much the same thing. Only component initialization can work with selector / HTMLElement.
Thanks for clarification.
I am in the process of migrating to the v4.2 version and I noticed that some
BSN.getInstance
calls are returning now NULL instead of the instance.I noticed this for dropdowns and collapse components. The components itself are working. I only can not get the instance by javascript.
html code:
js:
It seems the selector is not working?