ngx-bootstrap
ngx-bootstrap copied to clipboard
Dropdown menu not being rendered on init
I'm not able to get routerLink activated on the dropdown on init. It works after I trigger the dropdown by clicking on it once and keeps working even after I close it.
It isn't working on init because the dropdown DOM is not rendered by that point. It gets rendered after the dropdown button is clicked.
I want the dropdown list rendered and hidden on init please.
StackBlitz that reproduces the issue:
https://stackblitz.com/edit/ngx-bootstrap-dropdown
This is the default stackblitz for ngx-bootstrap-dropdown.
If DOM is observed, on init, the dropdown elements are not rendered but after it is opened and closed, the elements are there.
Same issue here. Currently didn't even come up with a solution. I need this for SSR.
Same here
@AhmadHassanAwan @6matko @deache
I don't know if you came up with a solution, but calling whatever method you need wrapped in a setTimeout() seems to do the trick for me.
I needed to focus on a search field inside the dropdown, and without giving a number it triggers immediately.
When i click the first time on my dropdown, my menu is taking some times to show completely (I have icons inside). But once i opened it once, it works fine because the code is now present in the DOM. But i found a solution but i'm not sure it's a good idea.
How to force the prerender of the menu ? Remove the *dropdownMenu from the ul tag
im having the same issue, is this the best solution? @GaetanRouzies btw, it is not working on mobile when i have submenu