selection-ranges
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -9,2 +9,6 @@ # Changelog | ||
## 1.2.0 | ||
* `FEAT`: support MS Edge style `div` containers | ||
## 1.1.0 | ||
@@ -11,0 +15,0 @@ |
37
index.js
@@ -50,7 +50,3 @@ 'use strict'; | ||
if (el !== focusNode && !el.contains(focusNode)) { | ||
return false; | ||
} | ||
return true; | ||
return el == focusNode || el.contains(focusNode); | ||
} | ||
@@ -142,5 +138,10 @@ | ||
if (!isClosing) { | ||
// <br />, </div>, </p> node | ||
if (isBr(next) || isDiv(next)) { | ||
if ( | ||
isBr(next) || ( | ||
next.previousSibling && ( | ||
isDiv(next) || | ||
isParagraph(next) | ||
) | ||
) | ||
) { | ||
count++; | ||
@@ -150,7 +151,2 @@ } | ||
if (isClosing) { | ||
if (isParagraph(next)) { | ||
count++; | ||
} | ||
} | ||
@@ -272,3 +268,10 @@ if (isText(next)) { | ||
if (!isClosing) { | ||
if (isDiv(next) || isBr(next)) { | ||
if ( | ||
isBr(next) || ( | ||
next.previousSibling && ( | ||
isDiv(next) || | ||
isParagraph(next) | ||
) | ||
) | ||
) { | ||
count++; | ||
@@ -278,8 +281,2 @@ } | ||
if (isClosing) { | ||
if (isParagraph(next)) { | ||
count++; | ||
} | ||
} | ||
if (isText(next)) { | ||
@@ -286,0 +283,0 @@ |
{ | ||
"name": "selection-ranges", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Selection range manipulation for contenteditable elements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8612