From d13725de3faf771eded3adaf123cf7315bffe725 Mon Sep 17 00:00:00 2001 From: LB Date: Wed, 23 Oct 2024 14:48:47 +1000 Subject: [PATCH] [Fix] `no-redundant-roles`: Refine implicit role of `select` to include `combobox` scenarios Encode implicit roles for `select` elements based on roles defined in https://www.w3.org/TR/html-aria/#el-select - `select` (with a multiple attribute or a size attribute having value greater than 1) will have the implicit role 'listbox' - `select` (with NO multiple attribute and NO size attribute having value greater than 1) will have the implicit role 'combobox' Fixes #949 --- .../src/rules/no-redundant-roles-test.js | 21 ++- .../src/util/implicitRoles/select-test.js | 158 ++++++++++++++++++ src/util/implicitRoles/select.js | 18 +- 3 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 __tests__/src/util/implicitRoles/select-test.js diff --git a/__tests__/src/rules/no-redundant-roles-test.js b/__tests__/src/rules/no-redundant-roles-test.js index 068e54049..288d0903a 100644 --- a/__tests__/src/rules/no-redundant-roles-test.js +++ b/__tests__/src/rules/no-redundant-roles-test.js @@ -41,12 +41,31 @@ const alwaysValid = [ { code: '' }, { code: '