1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 01:02:31 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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