@textbus/platform-browser 4.2.2 → 4.2.3

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.
@@ -357,6 +357,7 @@ let SelectionBridge = class SelectionBridge {
357
357
  this.input = input;
358
358
  this.domAdapter = domAdapter;
359
359
  this.nativeSelection = document.getSelection();
360
+ this.syncSelectionFromNativeSelectionChange = true;
360
361
  this.selectionChangeEvent = new Subject();
361
362
  this.subs = [];
362
363
  this.connector = null;
@@ -669,7 +670,9 @@ let SelectionBridge = class SelectionBridge {
669
670
  }));
670
671
  }
671
672
  this.subs.push(fromEvent(document, 'selectionchange').pipe().subscribe(() => {
672
- this.syncSelection(connector);
673
+ if (this.syncSelectionFromNativeSelectionChange) {
674
+ this.syncSelection(connector);
675
+ }
673
676
  }));
674
677
  }
675
678
  syncSelection(connector) {
package/bundles/index.js CHANGED
@@ -359,6 +359,7 @@ exports.SelectionBridge = class SelectionBridge {
359
359
  this.input = input;
360
360
  this.domAdapter = domAdapter;
361
361
  this.nativeSelection = document.getSelection();
362
+ this.syncSelectionFromNativeSelectionChange = true;
362
363
  this.selectionChangeEvent = new stream.Subject();
363
364
  this.subs = [];
364
365
  this.connector = null;
@@ -671,7 +672,9 @@ exports.SelectionBridge = class SelectionBridge {
671
672
  }));
672
673
  }
673
674
  this.subs.push(stream.fromEvent(document, 'selectionchange').pipe().subscribe(() => {
674
- this.syncSelection(connector);
675
+ if (this.syncSelectionFromNativeSelectionChange) {
676
+ this.syncSelection(connector);
677
+ }
675
678
  }));
676
679
  }
677
680
  syncSelection(connector) {
@@ -15,6 +15,7 @@ export declare class SelectionBridge implements NativeSelectionBridge {
15
15
  private domAdapter;
16
16
  onSelectionChange: Observable<Range | null>;
17
17
  nativeSelection: globalThis.Selection;
18
+ syncSelectionFromNativeSelectionChange: boolean;
18
19
  private selectionChangeEvent;
19
20
  private subs;
20
21
  private sub;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
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",
@@ -25,8 +25,8 @@
25
25
  "typescript editor"
26
26
  ],
27
27
  "dependencies": {
28
- "@tanbo/stream": "^1.2.5",
29
- "@textbus/core": "^4.2.1",
28
+ "@tanbo/stream": "^1.2.6",
29
+ "@textbus/core": "^4.2.3",
30
30
  "@viewfly/core": "^1.0.5"
31
31
  },
32
32
  "devDependencies": {
@@ -47,5 +47,5 @@
47
47
  "bugs": {
48
48
  "url": "https://github.com/textbus/textbus.git/issues"
49
49
  },
50
- "gitHead": "cf4fd289b73bc777124a32fe42bb58eba05a34f1"
50
+ "gitHead": "d77564bc33b44ff9d04a03e9e69d7fbc2672087b"
51
51
  }