@textbus/platform-browser 3.7.5 → 3.7.6

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.
@@ -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) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "3.7.5",
3
+ "version": "3.7.6",
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": "799ab8aafd2d8ed262a797da7872df10720c694d"
51
+ "gitHead": "2bf443e8633bead50b95e48f859f31236aa6bd0e"
52
52
  }