-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: overlays block scroll as soon as they are created, even if they do not get presented #23942
Comments
Thanks for the issue. I can reproduce this behavior. When overlays are created, we create an |
@almothafar Did this cause any weird scrolling issues for you in some scenarios? Like not being able to scroll or interact with the app? |
@liamdebeasi I'm suspecting this is causing scrolling issues on iOS if you scroll really fast after the application is loaded. I have encountered this problem in two different iOS projects and its quite hard to reproduce. But when I reproduce it, I can find traces of this behaviour in the DOM such as Could be a false negative, but I'm curious to hear your opinion. I have also found mentions of the issue I'm describing here
I have also made a video of the problem happening, and had show compositing borders toggled on in safari dev tools. Pay attention to the number going up in the top left corner as I scroll. And as per webkit documentation here this does the following.
Meaning there is a repaint every scroll when its not working. And when it does eventually scroll, there is no repaint. I'm not sure if this is related but thought its an interesting observation Video #1ionic-6-scroll-bug.mov
The repaints in the video seem to be occurring on two elements
|
Hi guys, |
…28415) Issue number: Resolves #23942 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When an overlay is created (inserted in the DOM), but not presented, the scroll gesture is prevented. This behavior comes from the `connectedCallback` of `ion-backdrop`, where the gesture is prevented as soon as the backdrop is inserted in the DOM. This means in situations where a developer creates an overlay, but does not present it immediately, the user cannot scroll. This is not desired. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Scroll blocking behavior tied to the gesture has been removed from `ion-backdrop` and implemented into the overlays directly. - When an overlay is presented, scroll blocking is enabled on the `body` element (the user cannot scroll on the main content). - When the last presented overlay is dismissed, scroll blocking is disabled on the `body` element (the user can scroll on the main content). ## Does this introduce a breaking change? - [x] Yes - [ ] No `ion-backdrop` no longer prevents scrolling on the main content when the backdrop is either inserted into the DOM or removed from the DOM. Developers using Ionic overlays do not need to migrate their implementations. Developers with custom overlays using `ion-backdrop` internally can either use Ionic's gesture controller to disable scrolling when their overlay is presented/dismissed or can manually add the `backdrop-no-scroll` Ionic global class to the `body` element. <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> ---------
Thanks for the report. This was resolved via #28415, and a fix will be available in the upcoming major version of Ionic Framework. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prequisites
Ionic Framework Version
Current Behavior
When I create a new Alert using an Alert controller like
class
backdrop-no-scroll
got added to thebody
and preventing scroll in the web version of Ionic.Expected Behavior
That class should be added after I call
alert.present()
I think, not while creating the alert, as for example, I can initialize the alert andalert.present()
in a specific condition, instead of having all creation and presenting in the same code block.Steps to Reproduce
Just create an alert and don't call it or make a condition to call it.
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.17.1
Ionic Framework : @ionic/angular 5.8.0
@angular-devkit/build-angular : 12.2.6
@angular-devkit/schematics : 12.2.6
@angular/cli : 12.2.6
@ionic/angular-toolkit : 4.0.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed globally
native-run : 1.4.1
System:
NodeJS : v16.4.1 (/usr/bin/node)
npm : 7.23.0
OS : Linux 5.10
Additional Information
No response
The text was updated successfully, but these errors were encountered: