arreglar bug con shadow DOM de <audio>/<video>/<iframe>
This commit is contained in:
parent
0382be3351
commit
d6141ddee6
1 changed files with 10 additions and 1 deletions
|
@ -352,7 +352,16 @@ function setupEditor (editorEl) {
|
||||||
const range = sel.getRangeAt(0)
|
const range = sel.getRangeAt(0)
|
||||||
|
|
||||||
for (const [name, type] of Object.entries(typesWithProperties)) {
|
for (const [name, type] of Object.entries(typesWithProperties)) {
|
||||||
const result = findRecursiveChild(type.checkFn, range.commonAncestorContainer)
|
let result
|
||||||
|
try {
|
||||||
|
result = findRecursiveChild(type.checkFn, range.commonAncestorContainer)
|
||||||
|
} catch (err) {
|
||||||
|
// Permission denied or something...
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied
|
||||||
|
console.log("Error raro", err)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
type.updateInput(result, editorEl)
|
type.updateInput(result, editorEl)
|
||||||
result.classList.add("selected")
|
result.classList.add("selected")
|
||||||
|
|
Loading…
Reference in a new issue