Use the backdrop util in offcanvas, enforcing consistency #33545
+165
−50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 onmodal.js
to focus on vital things, and after merging to use it inoffcanvas
.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:
hide()
without add/remove event tricksif (allReadyOpen && allReadyOpen !== target)
, in case another is going to be open, when user clicks on trigger buttonCloses #33471, closes #33457, closes #33447, closes #33535, closes #33564
Preview: https://deploy-preview-33545--twbs-bootstrap.netlify.app/docs/5.0/components/offcanvas/