fix: redrawing problem on every key stroke

This commit is contained in:
Johannes Millan 2019-09-30 20:07:33 +02:00
parent 2e0e3c7bab
commit e07ae77044

View file

@ -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) => {