@codemirror/view 0.20.2 → 0.20.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.20.3 (2022-04-27)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug where the input handling could crash on repeated (or held) backspace presses on Chrome Android.
6
+
1
7
  ## 0.20.2 (2022-04-22)
2
8
 
3
9
  ### New features
package/dist/index.cjs CHANGED
@@ -2880,7 +2880,8 @@ function computeCompositionDeco(view, changes) {
2880
2880
  topView = topView.widget.topView;
2881
2881
  else if (topView)
2882
2882
  topView.parent = null;
2883
- return Decoration.set(Decoration.replace({ widget: new CompositionWidget(node, textNode, topView) }).range(newFrom, newTo));
2883
+ return Decoration.set(Decoration.replace({ widget: new CompositionWidget(node, textNode, topView), inclusive: true })
2884
+ .range(newFrom, newTo));
2884
2885
  }
2885
2886
  class CompositionWidget extends WidgetType {
2886
2887
  constructor(top, text, topView) {
@@ -5563,6 +5564,7 @@ class DOMObserver {
5563
5564
  let key = this.delayedAndroidKey;
5564
5565
  this.delayedAndroidKey = null;
5565
5566
  let startState = this.view.state;
5567
+ this.readSelectionRange();
5566
5568
  if (dispatchKey(this.view.contentDOM, key.key, key.keyCode))
5567
5569
  this.processRecords();
5568
5570
  else
package/dist/index.js CHANGED
@@ -2874,7 +2874,8 @@ function computeCompositionDeco(view, changes) {
2874
2874
  topView = topView.widget.topView;
2875
2875
  else if (topView)
2876
2876
  topView.parent = null;
2877
- return Decoration.set(Decoration.replace({ widget: new CompositionWidget(node, textNode, topView) }).range(newFrom, newTo));
2877
+ return Decoration.set(Decoration.replace({ widget: new CompositionWidget(node, textNode, topView), inclusive: true })
2878
+ .range(newFrom, newTo));
2878
2879
  }
2879
2880
  class CompositionWidget extends WidgetType {
2880
2881
  constructor(top, text, topView) {
@@ -5556,6 +5557,7 @@ class DOMObserver {
5556
5557
  let key = this.delayedAndroidKey;
5557
5558
  this.delayedAndroidKey = null;
5558
5559
  let startState = this.view.state;
5560
+ this.readSelectionRange();
5559
5561
  if (dispatchKey(this.view.contentDOM, key.key, key.keyCode))
5560
5562
  this.processRecords();
5561
5563
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "0.20.2",
3
+ "version": "0.20.3",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",