From 12080c4d1057b2df30327f685ee8d3aed62b4668 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:00:20 +0300 Subject: [PATCH 01/14] added roles list and listitem for the required elements --- coral-component-list/src/scripts/AnchorList.js | 6 +++++- coral-component-list/src/scripts/AnchorListItem.js | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index 04d07a63fb..523bedcc42 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -52,10 +52,14 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) this._trackEvent('click', 'coral-anchorlist-item', event, event.matchedTarget); } + _addRoleList() { + this.setAttribute('role', 'list'); + } + /** @ignore */ render() { super.render(); - + this._addRoleList(); this.classList.add(CLASSNAME); } }); diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index ecfd44f7bc..59d4624a38 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -45,7 +45,7 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn get disabled() { return super.disabled; } - + set disabled(value) { super.disabled = value; @@ -80,10 +80,14 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn } } + _addRolesList() { + this.setAttribute('role', 'listItem'); + } + /** @ignore */ render() { super.render(); - + this._addRolesList(); this.classList.add(CLASSNAME); } }); From 031a434db4e038d0f50ff71ee60ffddf1ab92c20 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:03:35 +0300 Subject: [PATCH 02/14] removed whitespace --- coral-component-list/src/scripts/AnchorListItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index 59d4624a38..b5eca7ea5e 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -45,7 +45,7 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn get disabled() { return super.disabled; } - + set disabled(value) { super.disabled = value; From eabed4478481f380ba18ffd2e2381d18579a15a2 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Thu, 26 Oct 2023 10:50:18 +0300 Subject: [PATCH 03/14] corrected listItem role --- coral-component-list/src/scripts/AnchorListItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index b5eca7ea5e..b4b0dd0180 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -81,7 +81,7 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn } _addRolesList() { - this.setAttribute('role', 'listItem'); + this.setAttribute('role', 'listitem'); } /** @ignore */ From f173bc4fe49ed2a766b86c793cd21cfa2a289894 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:24:40 +0300 Subject: [PATCH 04/14] add role list to parent --- coral-component-list/src/scripts/AnchorListItem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index b4b0dd0180..6b2a9793cc 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -82,6 +82,7 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn _addRolesList() { this.setAttribute('role', 'listitem'); + this.parentElement.setAttribute('role', 'list'); } /** @ignore */ From 89fd12fe2da49ce3da802d71579d5eb518134e54 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:39:04 +0300 Subject: [PATCH 05/14] restored initial added code --- coral-component-list/src/scripts/AnchorListItem.js | 1 - 1 file changed, 1 deletion(-) diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index 6b2a9793cc..b4b0dd0180 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -82,7 +82,6 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn _addRolesList() { this.setAttribute('role', 'listitem'); - this.parentElement.setAttribute('role', 'list'); } /** @ignore */ From 277381018d755a5710ae811891c670cb434f8b05 Mon Sep 17 00:00:00 2001 From: Pareesh Gupta Date: Wed, 20 Mar 2024 12:45:33 +0530 Subject: [PATCH 06/14] Update AnchorListItem.js --- coral-component-list/src/scripts/AnchorListItem.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index b4b0dd0180..684ff8d5f0 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -80,15 +80,11 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn } } - _addRolesList() { - this.setAttribute('role', 'listitem'); - } - /** @ignore */ render() { super.render(); - this._addRolesList(); this.classList.add(CLASSNAME); + this.setAttribute('role', 'listitem'); } }); From bd3c12a11d6f7262ee6f3e9e7a7cdf21bbdc6cca Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:48:31 +0200 Subject: [PATCH 07/14] added role list --- coral-component-list/src/scripts/AnchorList.js | 5 ----- coral-component-list/src/scripts/AnchorListItem.js | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index 523bedcc42..1c25b37365 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -52,14 +52,9 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) this._trackEvent('click', 'coral-anchorlist-item', event, event.matchedTarget); } - _addRoleList() { - this.setAttribute('role', 'list'); - } - /** @ignore */ render() { super.render(); - this._addRoleList(); this.classList.add(CLASSNAME); } }); diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index 684ff8d5f0..c1a66b6e29 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -84,6 +84,7 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn render() { super.render(); this.classList.add(CLASSNAME); + this.parentElement.setAttribute('role', 'list'); this.setAttribute('role', 'listitem'); } }); From 9385ee0f98b57925b0a4ffad85b80414e625aa91 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:49:31 +0200 Subject: [PATCH 08/14] added space --- coral-component-list/src/scripts/AnchorList.js | 1 + 1 file changed, 1 insertion(+) diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index 1c25b37365..04d07a63fb 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -55,6 +55,7 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) /** @ignore */ render() { super.render(); + this.classList.add(CLASSNAME); } }); From 2520aaf14d2576df17a4dc40e9319bc02d09f41e Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:51:37 +0200 Subject: [PATCH 09/14] added space --- coral-component-list/src/scripts/AnchorListItem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index c1a66b6e29..9c02e18daf 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -83,6 +83,7 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn /** @ignore */ render() { super.render(); + this.classList.add(CLASSNAME); this.parentElement.setAttribute('role', 'list'); this.setAttribute('role', 'listitem'); From 52c5adf7db7ac2c7eb961c93d7dd8405f3a6e38b Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:01:09 +0200 Subject: [PATCH 10/14] added role list --- coral-component-list/src/scripts/AnchorList.js | 4 ++++ coral-component-list/src/scripts/AnchorListItem.js | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index 04d07a63fb..6033e8720a 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -56,6 +56,10 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) render() { super.render(); + this.setAttribute('role', 'list'); + this.children.forEach(element => { + element.setAttribute('role', 'listitem'); + }); this.classList.add(CLASSNAME); } }); diff --git a/coral-component-list/src/scripts/AnchorListItem.js b/coral-component-list/src/scripts/AnchorListItem.js index 9c02e18daf..ecfd44f7bc 100644 --- a/coral-component-list/src/scripts/AnchorListItem.js +++ b/coral-component-list/src/scripts/AnchorListItem.js @@ -85,8 +85,6 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn super.render(); this.classList.add(CLASSNAME); - this.parentElement.setAttribute('role', 'list'); - this.setAttribute('role', 'listitem'); } }); From 2b4bce58382c97e687c1b1dc663d0f7e548a26e1 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:08:00 +0200 Subject: [PATCH 11/14] added role list --- coral-component-list/src/scripts/AnchorList.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index 6033e8720a..b0225b8285 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -57,9 +57,7 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) super.render(); this.setAttribute('role', 'list'); - this.children.forEach(element => { - element.setAttribute('role', 'listitem'); - }); + $(this).children().setAttribute('role', 'listitem'); this.classList.add(CLASSNAME); } }); From 1120396ca119907397200a8c4608a48b71ed4a2a Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:19:19 +0200 Subject: [PATCH 12/14] added role list --- coral-component-list/src/scripts/AnchorList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index b0225b8285..fc2a0d771d 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -57,7 +57,7 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) super.render(); this.setAttribute('role', 'list'); - $(this).children().setAttribute('role', 'listitem'); + this.children.setAttribute('role', 'listitem'); this.classList.add(CLASSNAME); } }); From 972c163d7db6e8c097bcf61c5887c2cbd0740fe5 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:27:07 +0200 Subject: [PATCH 13/14] added role listitem --- coral-base-list/src/scripts/BaseListItem.js | 1 + coral-component-list/src/scripts/AnchorList.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/coral-base-list/src/scripts/BaseListItem.js b/coral-base-list/src/scripts/BaseListItem.js index a8cc98644a..84a1c9f519 100644 --- a/coral-base-list/src/scripts/BaseListItem.js +++ b/coral-base-list/src/scripts/BaseListItem.js @@ -131,6 +131,7 @@ const BaseListItem = (superClass) => class extends BaseLabellable(superClass) { // The attribute that makes different types of list items co-exist // This is also used for event delegation this.setAttribute('coral-list-item', ''); + this.setAttribute('role', 'listitem'); // Fetch or create the content content zone element const content = this._elements.content; diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index fc2a0d771d..3d1351db1f 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -57,8 +57,6 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) super.render(); this.setAttribute('role', 'list'); - this.children.setAttribute('role', 'listitem'); - this.classList.add(CLASSNAME); } }); From a93bdfe3863a6aaa387a93c9491d4515d228fff9 Mon Sep 17 00:00:00 2001 From: StoianLucian <101817370+StoianLucian@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:47:37 +0200 Subject: [PATCH 14/14] added roles --- coral-base-list/src/scripts/BaseList.js | 1 + coral-component-list/src/scripts/AnchorList.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/coral-base-list/src/scripts/BaseList.js b/coral-base-list/src/scripts/BaseList.js index 552c7c74a8..d30899a115 100644 --- a/coral-base-list/src/scripts/BaseList.js +++ b/coral-base-list/src/scripts/BaseList.js @@ -222,6 +222,7 @@ const BaseList = (superClass) => class extends superClass { super.render(); this.classList.add(CLASSNAME); + this.setAttribute('role', 'list'); // Default reflected attributes if (!this._interaction) { diff --git a/coral-component-list/src/scripts/AnchorList.js b/coral-component-list/src/scripts/AnchorList.js index 3d1351db1f..8045f82191 100644 --- a/coral-component-list/src/scripts/AnchorList.js +++ b/coral-component-list/src/scripts/AnchorList.js @@ -56,7 +56,6 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement)) render() { super.render(); - this.setAttribute('role', 'list'); } });