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

Separate modal click functionality, utilizing backdrop callback #35554

Merged
merged 2 commits into from Jan 30, 2022

Conversation

GeoSot
Copy link
Member

@GeoSot GeoSot commented Dec 15, 2021

This MR tries to remove some tricks that are happening, inside modal.js. Instead of listen over modal click events, it delegates the listener to the backdrop already existing click callback.

  • Get opinions from css-team & accessibility expert

@@ -15,6 +15,7 @@
height: 100%;
overflow-x: hidden;
overflow-y: auto;
pointer-events: none;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickhlauke @ffoodd I would like you opinion on this. 😃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to all be working as intended

Copy link
Sponsor Contributor

@tkrotoff tkrotoff Apr 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried https://getbootstrap.com/docs/5.1/components/modal/#scrolling-long-content in Safari/iOS 15.4.1, Chrome 98/Android 11, Firefox 97/Android 11, as well as Chrome/Firefox/Edge latest on Windows. seem to all behave as they should @tkrotoff, unless I'm missing something? if there is a bug/problem here, suggest opening a new issue ticket

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickhlauke Please re-read my comment. Of course stable version 5.1.3 which does not contain this PR code works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, apologies @tkrotoff i did indeed read your comment backwards. i see what you mean now. confirming that with this change, the first long modal in https://deploy-preview-35554--twbs-bootstrap.netlify.app/docs/5.1/components/modal/#scrolling-long-content can't be scrolled in Chrome/Edge (though oddly, it does scroll in Firefox if you use the scrollwheel, but not with the regular scroll bar) on Windows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, for my delayed answer. We are aware of this issue, and we are on discussion how to solve it, (or to revert this commit)

any suggestions, are welcome

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suspect that for the first type of long modal (where the whole content of the overlay, which contains the actual modal itself, needs to scroll), there's no easy fix other than reverting the change here (as you effectively do want that container to be scrollable, so you can't neutralise pointer-events on it).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sadly tend to agree here. It is a pity for such a clear approach

@GeoSot GeoSot force-pushed the gs/separate-modal-functionality-for-backdrop branch from 8151a06 to 0e4bb1b Compare December 22, 2021 15:18
@GeoSot GeoSot marked this pull request as ready for review January 4, 2022 08:33
@GeoSot GeoSot requested review from a team as code owners January 4, 2022 08:33
@GeoSot GeoSot requested a review from ffoodd January 5, 2022 16:58
Copy link
Member

@ffoodd ffoodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tried it on my phone 👌

@GeoSot GeoSot added this to In progress in v5.2.0 via automation Jan 5, 2022
@GeoSot GeoSot moved this from In progress to Reviewer approved in v5.2.0 Jan 5, 2022
@XhmikosR XhmikosR marked this pull request as draft January 5, 2022 18:17
@GeoSot GeoSot marked this pull request as ready for review January 10, 2022 13:10
@GeoSot GeoSot force-pushed the gs/separate-modal-functionality-for-backdrop branch from 4058fbd to 6be4162 Compare January 30, 2022 12:58
@GeoSot GeoSot force-pushed the gs/separate-modal-functionality-for-backdrop branch from 6be4162 to 8c37637 Compare January 30, 2022 13:30
@GeoSot GeoSot merged commit dcbe7b6 into main Jan 30, 2022
@GeoSot GeoSot deleted the gs/separate-modal-functionality-for-backdrop branch January 30, 2022 13:39
v5.2.0 automation moved this from Reviewer approved to Done Jan 30, 2022
@GeoSot GeoSot mentioned this pull request Mar 28, 2022
3 tasks
@GeoSot GeoSot self-assigned this Apr 12, 2022
GeoSot added a commit that referenced this pull request May 11, 2022
…odal

* Revert #35554 and backdrop callback usage
  Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals"
mdo pushed a commit that referenced this pull request May 13, 2022
…odal

* Revert #35554 and backdrop callback usage
  Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals"
mdo added a commit that referenced this pull request May 13, 2022
* refactor(Modal.js): stop using backdrop class to handle clicks over modal

* Revert #35554 and backdrop callback usage
  Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals"

* Update .bundlewatch.config.json

Co-authored-by: Mark Otto <markd.otto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v5.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants