This PR makes use of a separated util, backdrop, and reverts some assumptions that had been made in order to proceed the initial Offcanvas PR
Based on #32439
Background:
The initial idea was to decouple Modal backdrop functionality, as it was scattered inside modal.js, giving the opportunity on modal.js to focus on vital things, and after merging to use it in offcanvas.
It was referenced sometimes here
Unfortunately merge process of #32439 stuck about 3 months ago. But Offcanvas had to go on.
So with this PR, I am trying to complete the initial plan:
- respect /share modal's backdrop functionality, keeping consistency
- listen click events over backdrop (only) and trigger
hide()without add/remove event tricks - achieve to hide foreign open offcanvas instances without glitches
if (allReadyOpen && allReadyOpen !== target), in case another is going to be open, when user clicks on trigger button
Closes #33471, closes #33457 (closed), closes #33447 (closed), closes #33535 (closed), closes #33564 (closed)
Preview: https://deploy-preview-33545--twbs-bootstrap.netlify.app/docs/5.0/components/offcanvas/