提交 8f2f9cc7 编写于 作者: A Alex Dima

Fixes #3869: Always use latest dimensions (cancelAndSet instead of setIfNotSet)

上级 9a4d2bf4
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册