Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the backdrop util in offcanvas, enforcing consistency #33545

Merged
merged 2 commits into from
Apr 19, 2021

Conversation

GeoSot
Copy link
Member

@GeoSot GeoSot commented Apr 4, 2021

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, closes #33447, closes #33535, closes #33564

Preview: https://deploy-preview-33545--twbs-bootstrap.netlify.app/docs/5.0/components/offcanvas/

@GeoSot GeoSot force-pushed the gs-add-backdrop-functionality-to-offcanvas branch 5 times, most recently from 0e222a2 to 0849ccc Compare April 14, 2021 21:51
@GeoSot GeoSot marked this pull request as ready for review April 14, 2021 21:54
@GeoSot GeoSot requested review from a team as code owners April 14, 2021 21:54
@XhmikosR XhmikosR changed the title Make usage of backdrop util on offcanvas, enforcing consistency Make use of the backdrop util in offcanvas, enforcing consistency Apr 15, 2021
@XhmikosR XhmikosR changed the title Make use of the backdrop util in offcanvas, enforcing consistency Use the backdrop util in offcanvas, enforcing consistency Apr 15, 2021
@GeoSot GeoSot force-pushed the gs-add-backdrop-functionality-to-offcanvas branch 2 times, most recently from 75681a9 to 29f600f Compare April 16, 2021 21:55
@GeoSot GeoSot force-pushed the gs-add-backdrop-functionality-to-offcanvas branch from 29f600f to 8ed7bf4 Compare April 17, 2021 21:24
@XhmikosR XhmikosR merged commit a9d7a62 into main Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants