@codemirror/view 6.43.10 → 6.43.11

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,11 @@
1
+ ## 6.43.11 (2026-09-03)
2
+
3
+ ### Bug fixes
4
+
5
+ Speed up handling of Enter/Backspace on iOS in cases where the browser's native behavior is to do nothing.
6
+
7
+ Fix the patch that avoids a crash in `posAtCoords` for non-rendered elements.
8
+
1
9
  ## 6.43.10 (2026-08-31)
2
10
 
3
11
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -3947,7 +3947,7 @@ class InlineCoordsScan {
3947
3947
  // on the y axis, move this.y into it, and retry the scan.
3948
3948
  if (!closestRect) {
3949
3949
  if (!below && !above)
3950
- return { i: positions[0], after: false };
3950
+ return { i: 0, after: false };
3951
3951
  let side = above && (!below || (this.y - above.bottom < below.top - this.y)) ? above : below;
3952
3952
  this.y = (side.top + side.bottom) / 2;
3953
3953
  return this.scan(positions, getRects, true);
@@ -4629,7 +4629,7 @@ class InputState {
4629
4629
  iosVirtualKeyboardOpen(this.view.win))
4630
4630
  mods.shiftKey = false;
4631
4631
  this.pendingIOSKey = { key: event.key, keyCode: event.keyCode, mods };
4632
- setTimeout(() => this.flushIOSKey(), 250);
4632
+ setTimeout(() => this.flushIOSKey(), 50);
4633
4633
  return true;
4634
4634
  }
4635
4635
  if (event.keyCode != 229)
@@ -4638,7 +4638,7 @@ class InputState {
4638
4638
  }
4639
4639
  flushIOSKey(change) {
4640
4640
  let key = this.pendingIOSKey;
4641
- if (!key)
4641
+ if (!key || this.view.observer.pendingRecords().length)
4642
4642
  return false;
4643
4643
  // This looks like an autocorrection before Enter
4644
4644
  if (key.key == "Enter" && change && change.from < change.to && /^\S+$/.test(change.insert.toString()))
package/dist/index.js CHANGED
@@ -3943,7 +3943,7 @@ class InlineCoordsScan {
3943
3943
  // on the y axis, move this.y into it, and retry the scan.
3944
3944
  if (!closestRect) {
3945
3945
  if (!below && !above)
3946
- return { i: positions[0], after: false };
3946
+ return { i: 0, after: false };
3947
3947
  let side = above && (!below || (this.y - above.bottom < below.top - this.y)) ? above : below;
3948
3948
  this.y = (side.top + side.bottom) / 2;
3949
3949
  return this.scan(positions, getRects, true);
@@ -4625,7 +4625,7 @@ class InputState {
4625
4625
  iosVirtualKeyboardOpen(this.view.win))
4626
4626
  mods.shiftKey = false;
4627
4627
  this.pendingIOSKey = { key: event.key, keyCode: event.keyCode, mods };
4628
- setTimeout(() => this.flushIOSKey(), 250);
4628
+ setTimeout(() => this.flushIOSKey(), 50);
4629
4629
  return true;
4630
4630
  }
4631
4631
  if (event.keyCode != 229)
@@ -4634,7 +4634,7 @@ class InputState {
4634
4634
  }
4635
4635
  flushIOSKey(change) {
4636
4636
  let key = this.pendingIOSKey;
4637
- if (!key)
4637
+ if (!key || this.view.observer.pendingRecords().length)
4638
4638
  return false;
4639
4639
  // This looks like an autocorrection before Enter
4640
4640
  if (key.key == "Enter" && change && change.from < change.to && /^\S+$/.test(change.insert.toString()))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.43.10",
3
+ "version": "6.43.11",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",