Update comment for scrollbar workaround
This is no longer an issue on Google Chrome, tested on Chrome 96 on Fedora 34, Windows 10, macOS 12 and Android 12. It is however an issue on Safari on macOS 12. Without this workaround we get scrollbars when making the browser window smaller, despite remote resize being enabled.
This commit is contained in:
parent
78eda3c040
commit
a78a7bf8aa
|
@ -703,12 +703,13 @@ export default class RFB extends EventTargetMixin {
|
|||
}
|
||||
|
||||
_fixScrollbars() {
|
||||
// This is a hack because Chrome screws up the calculation
|
||||
// for when scrollbars are needed. So to fix it we temporarily
|
||||
// toggle them off and on.
|
||||
// This is a hack because Safari on macOS screws up the calculation
|
||||
// for when scrollbars are needed. We get scrollbars when making the
|
||||
// browser smaller, despite remote resize being enabled. So to fix it
|
||||
// we temporarily toggle them off and on.
|
||||
const orig = this._screen.style.overflow;
|
||||
this._screen.style.overflow = 'hidden';
|
||||
// Force Chrome to recalculate the layout by asking for
|
||||
// Force Safari to recalculate the layout by asking for
|
||||
// an element's dimensions
|
||||
this._screen.getBoundingClientRect();
|
||||
this._screen.style.overflow = orig;
|
||||
|
|
Loading…
Reference in New Issue