diff --git a/service2.js b/service2.js index 5cc0844..9e9fd27 100644 --- a/service2.js +++ b/service2.js @@ -26,7 +26,6 @@ class BesService { this.hostElement = hostElement this.results = [] // Results of grammar-checking, one per each block/paragraph of text this.createCorrectionPanel() - this.firstCall = true // Disable browser built-in spell-checker to prevent collision with our grammar markup. this.originalSpellcheck = this.hostElement.spellcheck @@ -778,16 +777,7 @@ class BesDOMService extends BesTreeService { */ onInput() { // Now that the text is done changing, we can correctly calculate markup position. - // This is a way to resolve lagginess in repositioning markup with many mistakes. - if (this.firstCall) { - this.repositionAllMarkup() - this.firstCall = false - } - clearTimeout(this.debounceTimer) - this.debounceTimer = setTimeout(() => { - this.repositionAllMarkup() - this.firstCall = true - }, 300) + this.repositionAllMarkup() // Defer grammar-checking to reduce stress on grammar-checking server. this.timer = setTimeout(() => {