@textbus/platform-browser 3.7.5 → 3.7.7
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/bundles/index.esm.js +6 -2
- package/bundles/index.js +6 -2
- package/package.json +2 -2
package/bundles/index.esm.js
CHANGED
@@ -265,6 +265,9 @@ let SelectionBridge = class SelectionBridge {
|
|
265
265
|
return;
|
266
266
|
}
|
267
267
|
function tryOffset(position) {
|
268
|
+
if (!position.node) {
|
269
|
+
return;
|
270
|
+
}
|
268
271
|
if (position.node.nodeType === Node.TEXT_NODE) {
|
269
272
|
const len = position.node.textContent.length;
|
270
273
|
if (position.offset > len) {
|
@@ -278,9 +281,9 @@ let SelectionBridge = class SelectionBridge {
|
|
278
281
|
}
|
279
282
|
}
|
280
283
|
}
|
281
|
-
tryOffset(focus);
|
282
|
-
tryOffset(anchor);
|
283
284
|
try {
|
285
|
+
tryOffset(focus);
|
286
|
+
tryOffset(anchor);
|
284
287
|
this.nativeSelection.setBaseAndExtent(anchor.node, anchor.offset, focus.node, focus.offset);
|
285
288
|
}
|
286
289
|
catch (e) {
|
@@ -1785,6 +1788,7 @@ let MagicInput = class MagicInput extends Input {
|
|
1785
1788
|
}), fromEvent(textarea, 'compositionend').subscribe(() => {
|
1786
1789
|
isWriting = false;
|
1787
1790
|
}), fromEvent(textarea, 'beforeinput').subscribe(ev => {
|
1791
|
+
this.ignoreComposition = false;
|
1788
1792
|
if (this.isSafari) {
|
1789
1793
|
if (ev.inputType === 'insertFromComposition') {
|
1790
1794
|
isIgnore = true;
|
package/bundles/index.js
CHANGED
@@ -267,6 +267,9 @@ exports.SelectionBridge = class SelectionBridge {
|
|
267
267
|
return;
|
268
268
|
}
|
269
269
|
function tryOffset(position) {
|
270
|
+
if (!position.node) {
|
271
|
+
return;
|
272
|
+
}
|
270
273
|
if (position.node.nodeType === Node.TEXT_NODE) {
|
271
274
|
const len = position.node.textContent.length;
|
272
275
|
if (position.offset > len) {
|
@@ -280,9 +283,9 @@ exports.SelectionBridge = class SelectionBridge {
|
|
280
283
|
}
|
281
284
|
}
|
282
285
|
}
|
283
|
-
tryOffset(focus);
|
284
|
-
tryOffset(anchor);
|
285
286
|
try {
|
287
|
+
tryOffset(focus);
|
288
|
+
tryOffset(anchor);
|
286
289
|
this.nativeSelection.setBaseAndExtent(anchor.node, anchor.offset, focus.node, focus.offset);
|
287
290
|
}
|
288
291
|
catch (e) {
|
@@ -1787,6 +1790,7 @@ exports.MagicInput = class MagicInput extends Input {
|
|
1787
1790
|
}), stream.fromEvent(textarea, 'compositionend').subscribe(() => {
|
1788
1791
|
isWriting = false;
|
1789
1792
|
}), stream.fromEvent(textarea, 'beforeinput').subscribe(ev => {
|
1793
|
+
this.ignoreComposition = false;
|
1790
1794
|
if (this.isSafari) {
|
1791
1795
|
if (ev.inputType === 'insertFromComposition') {
|
1792
1796
|
isIgnore = true;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/platform-browser",
|
3
|
-
"version": "3.7.
|
3
|
+
"version": "3.7.7",
|
4
4
|
"description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
|
5
5
|
"main": "./bundles/index.js",
|
6
6
|
"module": "./bundles/index.esm.js",
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"bugs": {
|
49
49
|
"url": "https://github.com/textbus/textbus.git/issues"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "f778970701d92b72c4ea88d4583c33a27b339dd8"
|
52
52
|
}
|