@codemirror/view 6.15.1 → 6.15.2

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
+ ## 6.15.2 (2023-07-18)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix the check that made sure compositions are dropped when the selection is moved.
6
+
1
7
  ## 6.15.1 (2023-07-18)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -2993,8 +2993,7 @@ function findCompositionNode(view) {
2993
2993
  }
2994
2994
  }
2995
2995
  }
2996
- let { main } = view.state.selection;
2997
- return from > main.head || to < main.head ? null : { from, to, node: textNode };
2996
+ return { from, to, node: textNode };
2998
2997
  }
2999
2998
  function findCompositionRange(view, changes) {
3000
2999
  let found = findCompositionNode(view);
@@ -3020,7 +3019,8 @@ function findCompositionRange(view, changes) {
3020
3019
  else
3021
3020
  return null;
3022
3021
  }
3023
- if (view.state.doc.sliceString(fromB, toB) != text)
3022
+ let { main } = view.state.selection;
3023
+ if (view.state.doc.sliceString(fromB, toB) != text || fromB > main.head || toB < main.head)
3024
3024
  return null;
3025
3025
  let marks = [];
3026
3026
  let range = new ChangedRange(fromA, toA, fromB, toB);
package/dist/index.js CHANGED
@@ -2987,8 +2987,7 @@ function findCompositionNode(view) {
2987
2987
  }
2988
2988
  }
2989
2989
  }
2990
- let { main } = view.state.selection;
2991
- return from > main.head || to < main.head ? null : { from, to, node: textNode };
2990
+ return { from, to, node: textNode };
2992
2991
  }
2993
2992
  function findCompositionRange(view, changes) {
2994
2993
  let found = findCompositionNode(view);
@@ -3014,7 +3013,8 @@ function findCompositionRange(view, changes) {
3014
3013
  else
3015
3014
  return null;
3016
3015
  }
3017
- if (view.state.doc.sliceString(fromB, toB) != text)
3016
+ let { main } = view.state.selection;
3017
+ if (view.state.doc.sliceString(fromB, toB) != text || fromB > main.head || toB < main.head)
3018
3018
  return null;
3019
3019
  let marks = [];
3020
3020
  let range = new ChangedRange(fromA, toA, fromB, toB);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.15.1",
3
+ "version": "6.15.2",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",