From e07ae77044ce6f2a8d5d65fbc5292f5d97d58b3d Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Mon, 30 Sep 2019 20:07:33 +0200 Subject: [PATCH] fix: redrawing problem on every key stroke --- .../edit-on-click/content-editable-on-click.directive.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/ui/edit-on-click/content-editable-on-click.directive.ts b/src/app/ui/edit-on-click/content-editable-on-click.directive.ts index f0f695f475..cd6a7c2d06 100644 --- a/src/app/ui/edit-on-click/content-editable-on-click.directive.ts +++ b/src/app/ui/edit-on-click/content-editable-on-click.directive.ts @@ -45,11 +45,16 @@ export class ContentEditableOnClickDirective implements OnInit, OnDestroy { window.clearTimeout(this._redrawTimeout); // this fixes the bug where the text is not visible for some time // by triggering a redraw via el.offsetHeight - this._redrawTimeout = window.setTimeout(() => this._el.offsetHeight, 30); + // this._redrawTimeout = window.setTimeout(() => this._el.offsetHeight, 30); }); el.addEventListener('input', (ev) => { this._setValueFromElement(); + + // this fixes the bug where the text is not visible for some time + // by triggering a redraw via el.offsetHeight + // tslint:disable-next-line + this._el.offsetHeight; }); el.addEventListener('blur', (ev) => {