1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-11 17:53:59 +02:00

Fixed converting querySelectorAll results to array (#4099)

for Babel loose mode.
This commit is contained in:
dchikulaev
2021-04-01 05:26:38 +05:00
committed by GitHub
parent 469e6b26f5
commit 7a9b4c5787

View File

@@ -460,8 +460,12 @@ export const ReactEditor = {
range.setEnd(nearestNode, nearestOffset) range.setEnd(nearestNode, nearestOffset)
const contents = range.cloneContents() const contents = range.cloneContents()
const removals = [ const removals = [
...contents.querySelectorAll('[data-slate-zero-width]'), ...Array.prototype.slice.call(
...contents.querySelectorAll('[contenteditable=false]'), contents.querySelectorAll('[data-slate-zero-width]')
),
...Array.prototype.slice.call(
contents.querySelectorAll('[contenteditable=false]')
),
] ]
removals.forEach(el => { removals.forEach(el => {