Merge pull request #1198 from theFigurin/fix-selection-getting-demo

Fix Selection getting demo
This commit is contained in:
Ilya Kantor 2019-08-01 09:15:02 +03:00 committed by GitHub
commit ea9d389bd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -357,7 +357,7 @@ As text: <span id="astext"></span>
cloned.innerHTML = astext.innerHTML = "";
// Clone DOM nodes from ranges (we support multiselect here)
for (let i = 0; i < selection; i++) {
for (let i = 0; i < selection.rangeCount; i++) {
cloned.append(selection.getRangeAt(i).cloneContents());
}
@ -628,7 +628,7 @@ The most used recipes are probably:
// then apply Range methods to selection.getRangeAt(0)
// or, like here, to all ranges to support multi-select
for (let i = 0; i < selection; i++) {
for (let i = 0; i < selection.rangeCount; i++) {
cloned.append(selection.getRangeAt(i).cloneContents());
}
```