Skip to content

Determine if adding overflow hidden style to doc body is still required #9

@dlongley

Description

@dlongley

See:

// disable scrolling on body
const body = document.querySelector('body');
this._bodyOverflowStyle = body.style.overflow;
body.style.overflow = 'hidden';
if(!this._destroyed) {
this.dialog.show();
} else if(this.windowControl.show) {
this.windowControl.show();
}
}
}
/**
* Called by the client when it wants to hide UI.
*/
hide() {
if(this.visible) {
this.visible = false;
// restore `overflow` style on body
const body = document.querySelector('body');
if(this._bodyOverflowStyle) {
body.style.overflow = this._bodyOverflowStyle;
} else {
body.style.overflow = '';
}

This was added a long time ago -- potentially for browsers that needed a polyfill for HTML dialog. If this is no longer needed due to improvements in modern browsers (e.g., full support for dialog support), it would be good to remove it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions