How to offcanvas close after click on anchor link?

You don’t need javascript for that to work, just add a data attribute to the links in the offcanvas data-bs-dismiss="offcanvas" and it will work without any extra javascript.

3 Likes