mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
Render workbench inside visual viewport.
This commit is contained in:
@@ -477,6 +477,11 @@ export function getClientArea(element: HTMLElement): Dimension {
|
||||
return new Dimension(element.clientWidth, element.clientHeight);
|
||||
}
|
||||
|
||||
// If visual view port exits, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight
|
||||
if ((<any>window).visualViewport) {
|
||||
return new Dimension((<any>window).visualViewport.width, (<any>window).visualViewport.height);
|
||||
}
|
||||
|
||||
// Try innerWidth / innerHeight
|
||||
if (window.innerWidth && window.innerHeight) {
|
||||
return new Dimension(window.innerWidth, window.innerHeight);
|
||||
|
||||
Reference in New Issue
Block a user