Fix rendering mistakes in textarea instances following corrections
This commit is contained in:
parent
2192845cae
commit
f6ee559065
25
service.js
25
service.js
@ -300,18 +300,20 @@ class BesService {
|
|||||||
matches: matches
|
matches: matches
|
||||||
})
|
})
|
||||||
|
|
||||||
const dataToChange = this
|
if (!this.textAreaService) {
|
||||||
let observer = new MutationObserver(function (mutations) {
|
const dataToChange = this
|
||||||
mutations.forEach(mutation => {
|
let observer = new MutationObserver(function (mutations) {
|
||||||
if (mutation.type === 'characterData') {
|
mutations.forEach(mutation => {
|
||||||
const el = dataToChange.children?.find(
|
if (mutation.type === 'characterData') {
|
||||||
child => child.element === mutation.target
|
const el = dataToChange.children?.find(
|
||||||
)
|
child => child.element === mutation.target
|
||||||
if (el) el.isProofed = false
|
)
|
||||||
}
|
if (el) el.isProofed = false
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
observer.observe(el, { characterData: true, subtree: true })
|
||||||
observer.observe(el, { characterData: true, subtree: true })
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -322,6 +324,7 @@ class BesService {
|
|||||||
clearMistakeMarkup(el) {
|
clearMistakeMarkup(el) {
|
||||||
let child = this.children?.find(child => child.element === el)
|
let child = this.children?.find(child => child.element === el)
|
||||||
if (!child) return
|
if (!child) return
|
||||||
|
if (this.textAreaService) child.isProofed = false
|
||||||
child.matches.forEach(match => {
|
child.matches.forEach(match => {
|
||||||
if (match?.highlights) {
|
if (match?.highlights) {
|
||||||
match.highlights.forEach(h => h.remove())
|
match.highlights.forEach(h => h.remove())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user