Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Expected: The page does not have a scroll bar. The HTML tag is not added with cdk-global-scrollblock.
Actually: When zoom the browser to 90%,drag the browser so that the width of the body is 1398.890px and there is no horizontal or vertical scroll bar.as a result, body.scrollWidth is 1399px, viewport.width is 1398px. cdk-global-scrollblock is added to the html tag.
private _canBeEnabled(): boolean {
// Since the scroll strategies can't be singletons, we have to use a global CSS class
// (cdk-global-scrollblock
) to make sure that we don't try to disable global
// scrolling multiple times.
const html = this._document.documentElement!;
if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {
return false;
}
const body = this._document.body;
const viewport = this._viewportRuler.getViewportSize();
return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;
}
Reproduction
Steps to reproduce:
- zoom the browser to 90%,
2.drag the browser so that the width of the body is 1398.890px
Expected Behavior
The page does not have a scroll bar. The HTML tag is not added with cdk-global-scrollblock.
Actual Behavior
The page does not have a scroll bar. The HTML tag is added with cdk-global-scrollblock.
Environment
- Angular: 14.2.0
- CDK/Material: 14.2.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): window 10