Commit c6f14b0
authored
fix(core): don't throw when the placeholder style is already removed (#3145)
The Placeholder plugin view removed its <style> on destroy with
removeChild, which throws NotFoundError if something else (e.g. Turbo
merging <head> and dropping duplicate empty <style> elements) detached
it first. The throw also aborts the rest of ProseMirror's view teardown.
Use styleEl.remove(), which is a no-op when the element has no parent
and covers both the document and shadow root cases.
Closes #3144
Co-authored-by: adarshsm <24850536+adarshsm@users.noreply.github.com>1 parent 14e14ca commit c6f14b0
2 files changed
Lines changed: 26 additions & 5 deletions
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
| |||
0 commit comments