@codemirror/autocomplete 6.10.0 → 6.10.1

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.10.1 (2023-10-11)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug where picking a selection with the mouse could use the wrong completion if the completion list was updated after being opened.
6
+
1
7
  ## 6.10.0 (2023-10-11)
2
8
 
3
9
  ### New features
package/dist/index.cjs CHANGED
@@ -472,6 +472,7 @@ class CompletionTooltip {
472
472
  this.dom.className = "cm-tooltip-autocomplete";
473
473
  this.updateTooltipClass(view.state);
474
474
  this.dom.addEventListener("mousedown", (e) => {
475
+ let { options } = view.state.field(stateField).open;
475
476
  for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) {
476
477
  if (dom.nodeName == "LI" && (match = /-(\d+)$/.exec(dom.id)) && +match[1] < options.length) {
477
478
  this.applyCompletion(view, options[+match[1]]);
package/dist/index.js CHANGED
@@ -470,6 +470,7 @@ class CompletionTooltip {
470
470
  this.dom.className = "cm-tooltip-autocomplete";
471
471
  this.updateTooltipClass(view.state);
472
472
  this.dom.addEventListener("mousedown", (e) => {
473
+ let { options } = view.state.field(stateField).open;
473
474
  for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) {
474
475
  if (dom.nodeName == "LI" && (match = /-(\d+)$/.exec(dom.id)) && +match[1] < options.length) {
475
476
  this.applyCompletion(view, options[+match[1]]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/autocomplete",
3
- "version": "6.10.0",
3
+ "version": "6.10.1",
4
4
  "description": "Autocompletion for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",