@codemirror/autocomplete 6.19.0 → 6.19.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.19.1 (2025-10-23)
2
+
3
+ ### Bug fixes
4
+
5
+ Make sure a completion's info panel is associated with that completion in the accessibility tree.
6
+
1
7
  ## 6.19.0 (2025-09-26)
2
8
 
3
9
  ### New features
package/dist/index.cjs CHANGED
@@ -590,7 +590,8 @@ class CompletionTooltip {
590
590
  this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);
591
591
  this.showOptions(open.options, cState.id);
592
592
  }
593
- if (this.updateSelectedOption(open.selected)) {
593
+ let newSel = this.updateSelectedOption(open.selected);
594
+ if (newSel) {
594
595
  this.destroyInfo();
595
596
  let { completion } = open.options[open.selected];
596
597
  let { info } = completion;
@@ -607,6 +608,7 @@ class CompletionTooltip {
607
608
  }
608
609
  else {
609
610
  this.addInfoPane(infoResult, completion);
611
+ newSel.setAttribute("aria-describedby", this.info.id);
610
612
  }
611
613
  }
612
614
  }
@@ -614,6 +616,7 @@ class CompletionTooltip {
614
616
  this.destroyInfo();
615
617
  let wrap = this.info = document.createElement("div");
616
618
  wrap.className = "cm-tooltip cm-completionInfo";
619
+ wrap.id = "cm-completionInfo-" + Math.floor(Math.random() * 0xffff).toString(16);
617
620
  if (content.nodeType != null) {
618
621
  wrap.appendChild(content);
619
622
  this.infoDestroy = null;
@@ -639,8 +642,10 @@ class CompletionTooltip {
639
642
  }
640
643
  }
641
644
  else {
642
- if (opt.hasAttribute("aria-selected"))
645
+ if (opt.hasAttribute("aria-selected")) {
643
646
  opt.removeAttribute("aria-selected");
647
+ opt.removeAttribute("aria-describedby");
648
+ }
644
649
  }
645
650
  }
646
651
  if (set)
package/dist/index.js CHANGED
@@ -588,7 +588,8 @@ class CompletionTooltip {
588
588
  this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);
589
589
  this.showOptions(open.options, cState.id);
590
590
  }
591
- if (this.updateSelectedOption(open.selected)) {
591
+ let newSel = this.updateSelectedOption(open.selected);
592
+ if (newSel) {
592
593
  this.destroyInfo();
593
594
  let { completion } = open.options[open.selected];
594
595
  let { info } = completion;
@@ -605,6 +606,7 @@ class CompletionTooltip {
605
606
  }
606
607
  else {
607
608
  this.addInfoPane(infoResult, completion);
609
+ newSel.setAttribute("aria-describedby", this.info.id);
608
610
  }
609
611
  }
610
612
  }
@@ -612,6 +614,7 @@ class CompletionTooltip {
612
614
  this.destroyInfo();
613
615
  let wrap = this.info = document.createElement("div");
614
616
  wrap.className = "cm-tooltip cm-completionInfo";
617
+ wrap.id = "cm-completionInfo-" + Math.floor(Math.random() * 0xffff).toString(16);
615
618
  if (content.nodeType != null) {
616
619
  wrap.appendChild(content);
617
620
  this.infoDestroy = null;
@@ -637,8 +640,10 @@ class CompletionTooltip {
637
640
  }
638
641
  }
639
642
  else {
640
- if (opt.hasAttribute("aria-selected"))
643
+ if (opt.hasAttribute("aria-selected")) {
641
644
  opt.removeAttribute("aria-selected");
645
+ opt.removeAttribute("aria-describedby");
646
+ }
642
647
  }
643
648
  }
644
649
  if (set)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/autocomplete",
3
- "version": "6.19.0",
3
+ "version": "6.19.1",
4
4
  "description": "Autocompletion for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",