mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-11 00:59:24 +01:00
Fixes #3869: Always use latest dimensions (cancelAndSet instead of setIfNotSet)
This commit is contained in:
@@ -137,8 +137,9 @@ export class ScrollableElement extends Widget implements IScrollableElement {
|
||||
public onElementDimensions(dimensions: IDimensions = null, synchronous: boolean = false): void {
|
||||
if (synchronous) {
|
||||
this._actualElementDimensions(dimensions);
|
||||
this._onElementDimensionsTimeout.cancel();
|
||||
} else {
|
||||
this._onElementDimensionsTimeout.setIfNotSet(() => this._actualElementDimensions(dimensions), 0);
|
||||
this._onElementDimensionsTimeout.cancelAndSet(() => this._actualElementDimensions(dimensions), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +158,7 @@ export class ScrollableElement extends Widget implements IScrollableElement {
|
||||
public onElementInternalDimensions(synchronous: boolean = false): void {
|
||||
if (synchronous) {
|
||||
this._actualElementInternalDimensions();
|
||||
this._onElementInternalDimensionsTimeout.cancel();
|
||||
} else {
|
||||
this._onElementInternalDimensionsTimeout.setIfNotSet(() => this._actualElementInternalDimensions(), 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user