@codemirror/autocomplete
Advanced tools
Comparing version 0.19.13 to 0.19.14
@@ -0,1 +1,7 @@ | ||
## 0.19.14 (2022-03-10) | ||
### Bug fixes | ||
Make the ARIA attributes added to the editor during autocompletion spec-compliant. | ||
## 0.19.13 (2022-02-18) | ||
@@ -2,0 +8,0 @@ |
@@ -513,2 +513,3 @@ import { Annotation, Facet, combineConfig, StateEffect, StateField, Prec, EditorSelection, Text, MapMode } from '@codemirror/state'; | ||
ul.setAttribute("role", "listbox"); | ||
ul.setAttribute("aria-expanded", "true"); | ||
for (let i = range.from; i < range.to; i++) { | ||
@@ -574,3 +575,2 @@ let { completion, match } = options[i]; | ||
} | ||
options.sort(cmpOption); | ||
let result = [], prev = null; | ||
@@ -608,6 +608,7 @@ for (let opt of options.sort(cmpOption)) { | ||
let selectedValue = prev.options[prev.selected].completion; | ||
for (let i = 0; i < options.length && !selected; i++) { | ||
if (options[i].completion == selectedValue) | ||
for (let i = 0; i < options.length; i++) | ||
if (options[i].completion == selectedValue) { | ||
selected = i; | ||
} | ||
break; | ||
} | ||
} | ||
@@ -673,4 +674,3 @@ return new CompletionDialog(options, makeAttrs(id, selected), { | ||
const baseAttrs = { | ||
"aria-autocomplete": "list", | ||
"aria-expanded": "false" | ||
"aria-autocomplete": "list" | ||
}; | ||
@@ -680,3 +680,3 @@ function makeAttrs(id, selected) { | ||
"aria-autocomplete": "list", | ||
"aria-expanded": "true", | ||
"aria-haspopup": "listbox", | ||
"aria-activedescendant": id + "-" + selected, | ||
@@ -863,3 +863,3 @@ "aria-controls": id | ||
if (doesReset || | ||
query.updates.length + update.transactions.length > MaxUpdateCount && query.time - Date.now() > MinAbortTime) { | ||
query.updates.length + update.transactions.length > MaxUpdateCount && Date.now() - query.time > MinAbortTime) { | ||
for (let handler of query.context.abortListeners) { | ||
@@ -866,0 +866,0 @@ try { |
{ | ||
"name": "@codemirror/autocomplete", | ||
"version": "0.19.13", | ||
"version": "0.19.14", | ||
"description": "Autocompletion for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141334