Add no close on click option to offcanvas (originally:Using datepicker in OffCanvas (BS5))

Can the datepicker element be used inside an offcanvas element? If you click on the datepicker the offcanvas closes.

I tried removing the tabindex = "-1" which was required for some things in BS4 but it has no effect. I suspect it is to do with the offcanvas implementation.

As a workaround, I’ve found that you can add:

document.body.addEventListener('click', function (e) {
    e.stopPropagation()
})

to a javascript file linked to your page (or in script tags on your page)

It would be good, though, if you had the option, like you do for modals, to ‘No close on click’