While working on a website, I incorporated Knockout.js and added a click event to a href in the navbar. The issue is that the navbar doesn't automatically close when using it on a mobile device after the click event triggers.
Is there a way to ensure that Bootstrap closes the navbar once the Knockout function has finished executing?
--Updated--
I have experimented with returning true from the ViewModel function and also from the function defined on the href element, like so:
<a href="#" data-bind="click: function(data, event) { doINeedToLogIn('bookings', data, event); return true; }">My Bookings</a>
Unfortunately, these attempts were unsuccessful as the navbar did not close. I even tried replacing the href element with a button in the navbar, but encountered the same problem. This issue can be replicated by resizing a desktop browser window to trigger the site's mobile mode.
Any suggestions?