diff --git a/README.md b/README.md index d00c435..d4e86e6 100644 --- a/README.md +++ b/README.md @@ -615,7 +615,7 @@ const example = new Choices(element, { **Input types affected:** `select-one`, `select-multiple` -**Usage:** The labelId improves accessibility. If set, it will add aria-labeledby to the choices element. +**Usage:** The labelId improves accessibility. If set, it will add aria-labelledby to the choices element. ### classNames diff --git a/package-lock.json b/package-lock.json index df0061b..f92efcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21873,6 +21873,28 @@ "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -22447,6 +22469,12 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", diff --git a/public/types/src/scripts/interfaces/options.d.ts b/public/types/src/scripts/interfaces/options.d.ts index 809525f..0952366 100644 --- a/public/types/src/scripts/interfaces/options.d.ts +++ b/public/types/src/scripts/interfaces/options.d.ts @@ -412,7 +412,7 @@ export interface Options { */ fuseOptions: Fuse.IFuseOptions; /** - * ID of the connected label to improve a11y. If set, aria-labeledby will be added. + * ID of the connected label to improve a11y. If set, aria-labelledby will be added. */ labelId: string; /** diff --git a/src/scripts/interfaces/options.ts b/src/scripts/interfaces/options.ts index d11f6e1..4a4e22f 100644 --- a/src/scripts/interfaces/options.ts +++ b/src/scripts/interfaces/options.ts @@ -454,7 +454,7 @@ export interface Options { fuseOptions: Fuse.IFuseOptions; /** - * ID of the connected label to improve a11y. If set, aria-labeledby will be added. + * ID of the connected label to improve a11y. If set, aria-labelledby will be added. */ labelId: string; diff --git a/src/scripts/templates.test.ts b/src/scripts/templates.test.ts index 3117ed8..c4af469 100644 --- a/src/scripts/templates.test.ts +++ b/src/scripts/templates.test.ts @@ -95,7 +95,7 @@ describe('templates', () => { tabindex="0" aria-haspopup="true" aria-expanded="false" - aria-labeledby="${labelId}" + aria-labelledby="${labelId}" dir="${direction}" > diff --git a/src/scripts/templates.ts b/src/scripts/templates.ts index 14e1e58..ee4eafd 100644 --- a/src/scripts/templates.ts +++ b/src/scripts/templates.ts @@ -45,7 +45,7 @@ const templates = { div.setAttribute('aria-haspopup', 'true'); div.setAttribute('aria-expanded', 'false'); if (labelId) { - div.setAttribute('aria-labeledby', labelId); + div.setAttribute('aria-labelledby', labelId); } return div; diff --git a/src/styles/choices.scss b/src/styles/choices.scss index 5d31cee..d9fc434 100644 --- a/src/styles/choices.scss +++ b/src/styles/choices.scss @@ -23,7 +23,7 @@ $choices-button-dimension: 8px !default; $choices-button-offset: 8px !default; $choices-icon-cross: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==") !default; $choices-icon-cross-inverse: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==") !default; -$choices-z-index: 1; +$choices-z-index: 1 !default; .#{$choices-selector} { position: relative;