From 72da548a64d26d2c66650b8f36ef443167dc20e8 Mon Sep 17 00:00:00 2001 From: David DIVERRES Date: Fri, 1 Apr 2022 14:13:08 +0200 Subject: [PATCH] Fix typo on aria-labelledby attribute --- README.md | 2 +- public/types/src/scripts/interfaces/options.d.ts | 2 +- src/scripts/interfaces/options.ts | 2 +- src/scripts/templates.test.ts | 2 +- src/scripts/templates.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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/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;