@codemirror/view 0.19.12 → 0.19.13

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.19.13 (2021-11-06)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug where backspace, enter, and delete would get applied twice on iOS.
6
+
1
7
  ## 0.19.12 (2021-11-04)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -3213,7 +3213,7 @@ class InputState {
3213
3213
  }
3214
3214
  setPendingKey(view, pending) {
3215
3215
  this.pendingKey = pending;
3216
- requestAnimationFrame(() => {
3216
+ let flush = () => {
3217
3217
  if (!this.pendingKey)
3218
3218
  return false;
3219
3219
  let key = this.pendingKey;
@@ -3223,7 +3223,11 @@ class InputState {
3223
3223
  dispatchKey(view.contentDOM, key.key, key.keyCode);
3224
3224
  if (view.state == startState)
3225
3225
  view.docView.reset(true);
3226
- });
3226
+ };
3227
+ if (browser.ios)
3228
+ setTimeout(() => requestAnimationFrame(flush), 50);
3229
+ else
3230
+ requestAnimationFrame(flush);
3227
3231
  }
3228
3232
  ignoreDuringComposition(event) {
3229
3233
  if (!/^key/.test(event.type))
package/dist/index.js CHANGED
@@ -3208,7 +3208,7 @@ class InputState {
3208
3208
  }
3209
3209
  setPendingKey(view, pending) {
3210
3210
  this.pendingKey = pending;
3211
- requestAnimationFrame(() => {
3211
+ let flush = () => {
3212
3212
  if (!this.pendingKey)
3213
3213
  return false;
3214
3214
  let key = this.pendingKey;
@@ -3218,7 +3218,11 @@ class InputState {
3218
3218
  dispatchKey(view.contentDOM, key.key, key.keyCode);
3219
3219
  if (view.state == startState)
3220
3220
  view.docView.reset(true);
3221
- });
3221
+ };
3222
+ if (browser.ios)
3223
+ setTimeout(() => requestAnimationFrame(flush), 50);
3224
+ else
3225
+ requestAnimationFrame(flush);
3222
3226
  }
3223
3227
  ignoreDuringComposition(event) {
3224
3228
  if (!/^key/.test(event.type))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "0.19.12",
3
+ "version": "0.19.13",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",