@codemirror/autocomplete 6.16.2 → 6.16.3

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.16.3 (2024-06-19)
2
+
3
+ ### Bug fixes
4
+
5
+ Avoid adding an `aria-autocomplete` attribute to the editor when there are no active sources active.
6
+
1
7
  ## 6.16.2 (2024-05-31)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -852,7 +852,7 @@ class CompletionState {
852
852
  return active == this.active && open == this.open ? this : new CompletionState(active, this.id, open);
853
853
  }
854
854
  get tooltip() { return this.open ? this.open.tooltip : null; }
855
- get attrs() { return this.open ? this.open.attrs : baseAttrs; }
855
+ get attrs() { return this.open ? this.open.attrs : this.active.length ? baseAttrs : noAttrs; }
856
856
  }
857
857
  function sameResults(a, b) {
858
858
  if (a == b)
@@ -872,6 +872,7 @@ function sameResults(a, b) {
872
872
  const baseAttrs = {
873
873
  "aria-autocomplete": "list"
874
874
  };
875
+ const noAttrs = {};
875
876
  function makeAttrs(id, selected) {
876
877
  let result = {
877
878
  "aria-autocomplete": "list",
package/dist/index.js CHANGED
@@ -850,7 +850,7 @@ class CompletionState {
850
850
  return active == this.active && open == this.open ? this : new CompletionState(active, this.id, open);
851
851
  }
852
852
  get tooltip() { return this.open ? this.open.tooltip : null; }
853
- get attrs() { return this.open ? this.open.attrs : baseAttrs; }
853
+ get attrs() { return this.open ? this.open.attrs : this.active.length ? baseAttrs : noAttrs; }
854
854
  }
855
855
  function sameResults(a, b) {
856
856
  if (a == b)
@@ -870,6 +870,7 @@ function sameResults(a, b) {
870
870
  const baseAttrs = {
871
871
  "aria-autocomplete": "list"
872
872
  };
873
+ const noAttrs = {};
873
874
  function makeAttrs(id, selected) {
874
875
  let result = {
875
876
  "aria-autocomplete": "list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/autocomplete",
3
- "version": "6.16.2",
3
+ "version": "6.16.3",
4
4
  "description": "Autocompletion for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",