@cocreate/text 1.17.3 → 1.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/updateDom.js +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [1.17.4](https://github.com/CoCreate-app/CoCreate-text/compare/v1.17.3...v1.17.4) (2022-08-18)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* if CurCaret.range ([a0a1678](https://github.com/CoCreate-app/CoCreate-text/commit/a0a1678236f1805ec246def322eedad4267ce498))
|
7
|
+
|
1
8
|
## [1.17.3](https://github.com/CoCreate-app/CoCreate-text/compare/v1.17.2...v1.17.3) (2022-07-25)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/updateDom.js
CHANGED
@@ -147,8 +147,8 @@ export function updateDom({domTextEditor, value, start, end, html}) {
|
|
147
147
|
domTextEditor.htmlString = html;
|
148
148
|
|
149
149
|
if(curCaret && start >= 0 && end >= 0) {
|
150
|
-
if (curCaret.range.startContainer == domEl)
|
151
|
-
if (curCaret.
|
150
|
+
if (curCaret.range && curCaret.range.startContainer == domEl)
|
151
|
+
if (curCaret.start >= curCaret.range.startOffset) {
|
152
152
|
let p = processSelection(domEl, value, curCaret.start, curCaret.end, start, end, curCaret.range);
|
153
153
|
sendPosition(domEl);
|
154
154
|
_dispatchInputEvent(p.element, p.value, p.start, p.end, p.prev_start, p.prev_end);
|