Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-162026 [Milo][Sev2][Catalog] Group of checkboxes is missing FIELDSET … #3518

Merged
merged 9 commits into from
Jan 28, 2025
Merged
9 changes: 9 additions & 0 deletions libs/deps/mas/mas.js

Large diffs are not rendered by default.

31 changes: 20 additions & 11 deletions libs/deps/mas/merch-card.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions libs/deps/mas/merch-sidenav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var I=Object.defineProperty;var v=o=>{throw TypeError(o)};var V=(o,e,t)=>e in o?I(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>V(o,typeof e!="symbol"?e+"":e,t),g=(o,e,t)=>e.has(o)||v("Cannot "+t);var S=(o,e,t)=>(g(o,e,"read from private field"),t?t.call(o):e.get(o)),b=(o,e,t)=>e.has(o)?v("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),C=(o,e,t,s)=>(g(o,e,"write to private field"),s?s.call(o,t):e.set(o,t),t);import{html as M,css as K,LitElement as W}from"/libs/deps/lit-all.min.js";var c=class{constructor(e,t){this.key=Symbol("match-media-key"),this.matches=!1,this.host=e,this.host.addController(this),this.media=window.matchMedia(t),this.matches=this.media.matches,this.onChange=this.onChange.bind(this),e.addController(this)}hostConnected(){var e;(e=this.media)==null||e.addEventListener("change",this.onChange)}hostDisconnected(){var e;(e=this.media)==null||e.removeEventListener("change",this.onChange)}onChange(e){this.matches!==e.matches&&(this.matches=e.matches,this.host.requestUpdate(this.key,!this.matches))}};import{css as P}from"/libs/deps/lit-all.min.js";var u=P`
var P=Object.defineProperty;var v=o=>{throw TypeError(o)};var H=(o,e,t)=>e in o?P(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var n=(o,e,t)=>H(o,typeof e!="symbol"?e+"":e,t),g=(o,e,t)=>e.has(o)||v("Cannot "+t);var b=(o,e,t)=>(g(o,e,"read from private field"),t?t.call(o):e.get(o)),S=(o,e,t)=>e.has(o)?v("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),A=(o,e,t,s)=>(g(o,e,"write to private field"),s?s.call(o,t):e.set(o,t),t);import{html as M,css as j,LitElement as z}from"/libs/deps/lit-all.min.js";var l=class{constructor(e,t){this.key=Symbol("match-media-key"),this.matches=!1,this.host=e,this.host.addController(this),this.media=window.matchMedia(t),this.matches=this.media.matches,this.onChange=this.onChange.bind(this),e.addController(this)}hostConnected(){var e;(e=this.media)==null||e.addEventListener("change",this.onChange)}hostDisconnected(){var e;(e=this.media)==null||e.removeEventListener("change",this.onChange)}onChange(e){this.matches!==e.matches&&(this.matches=e.matches,this.host.requestUpdate(this.key,!this.matches))}};import{css as F}from"/libs/deps/lit-all.min.js";var u=F`
h2 {
font-size: 11px;
font-style: normal;
Expand All @@ -9,13 +9,13 @@ var I=Object.defineProperty;var v=o=>{throw TypeError(o)};var V=(o,e,t)=>e in o?
line-height: 32px;
color: #747474;
}
`;import{html as F,LitElement as U}from"/libs/deps/lit-all.min.js";function E(o,e){let t;return function(){let s=this,n=arguments;clearTimeout(t),t=setTimeout(()=>o.apply(s,n),e)}}var T="merch-search:change";var A="merch-sidenav:select";var y="hashchange";function r(o=window.location.hash){let e=[],t=o.replace(/^#/,"").split("&");for(let s of t){let[n,m=""]=s.split("=");n&&e.push([n,decodeURIComponent(m.replace(/\+/g," "))])}return Object.fromEntries(e)}function a(o,e){if(o.deeplink){let t={};t[o.deeplink]=e,H(t)}}function H(o){let e=new URLSearchParams(window.location.hash.slice(1));Object.entries(o).forEach(([n,m])=>{m?e.set(n,m):e.delete(n)}),e.sort();let t=e.toString();if(t===window.location.hash)return;let s=window.scrollY||document.documentElement.scrollTop;window.location.hash=t,window.scrollTo(0,s)}function w(o){let e=()=>{if(window.location.hash&&!window.location.hash.includes("="))return;let t=r(window.location.hash);o(t)};return e(),window.addEventListener(y,e),()=>{window.removeEventListener(y,e)}}var f=class extends U{get search(){return this.querySelector("sp-search")}constructor(){super(),this.handleInput=()=>{a(this,this.search.value),this.search.value&&this.dispatchEvent(new CustomEvent(T,{bubbles:!0,composed:!0,detail:{type:"search",value:this.search.value}}))},this.handleInputDebounced=E(this.handleInput.bind(this))}connectedCallback(){super.connectedCallback(),this.search&&(this.search.addEventListener("input",this.handleInputDebounced),this.search.addEventListener("submit",this.handleInputSubmit),this.updateComplete.then(()=>{this.setStateFromURL()}),this.startDeeplink())}disconnectedCallback(){super.disconnectedCallback(),this.search.removeEventListener("input",this.handleInputDebounced),this.search.removeEventListener("submit",this.handleInputSubmit),this.stopDeeplink?.()}setStateFromURL(){let t=r()[this.deeplink];t&&(this.search.value=t)}startDeeplink(){this.stopDeeplink=w(({search:e})=>{this.search.value=e??""})}handleInputSubmit(e){e.preventDefault()}render(){return F`<slot></slot>`}};i(f,"properties",{deeplink:{type:String}});customElements.define("merch-search",f);import{html as R,LitElement as B,css as G}from"/libs/deps/lit-all.min.js";var l=class extends B{constructor(){super(),this.handleClickDebounced=E(this.handleClick.bind(this))}selectElement(e,t=!0){e.parentNode.tagName==="SP-SIDENAV-ITEM"&&this.selectElement(e.parentNode,!1),t&&(this.selectedElement=e,this.selectedText=e.label,this.selectedValue=e.value,setTimeout(()=>{e.selected=!0},1),this.dispatchEvent(new CustomEvent(A,{bubbles:!0,composed:!0,detail:{type:"sidenav",value:this.selectedValue,elt:this.selectedElement}})))}setStateFromURL(){let t=r()[this.deeplink]??"all";if(t){let s=this.querySelector(`sp-sidenav-item[value="${t}"]`);if(!s)return;this.updateComplete.then(()=>{s.firstElementChild?.tagName==="SP-SIDENAV-ITEM"&&(s.expanded=!0),this.selectElement(s)})}}handleClick({target:e}){let{value:t,parentNode:s}=e;this.selectElement(e),s&&s.tagName==="SP-SIDENAV"&&(a(this,t),e.selected=!0,s.querySelectorAll("sp-sidenav-item[expanded],sp-sidenav-item[selected]").forEach(n=>{n.value!==t&&(n.expanded=!1,n.selected=!1)}))}selectionChanged({target:{value:e,parentNode:t}}){this.selectElement(this.querySelector(`sp-sidenav-item[value="${e}"]`)),a(this,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClickDebounced),this.updateComplete.then(()=>{this.setStateFromURL()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClickDebounced)}render(){return R`<div
`;import{html as B,LitElement as G}from"/libs/deps/lit-all.min.js";function E(o,e){let t;return function(){let s=this,i=arguments;clearTimeout(t),t=setTimeout(()=>o.apply(s,i),e)}}function C(o,e={},t=null,s=null){let i=s?document.createElement(o,{is:s}):document.createElement(o);t instanceof HTMLElement?i.appendChild(t):i.innerHTML=t;for(let[c,V]of Object.entries(e))i.setAttribute(c,V);return i}var T="merch-search:change";var y="merch-sidenav:select";var w="hashchange";function r(o=window.location.hash){let e=[],t=o.replace(/^#/,"").split("&");for(let s of t){let[i,c=""]=s.split("=");i&&e.push([i,decodeURIComponent(c.replace(/\+/g," "))])}return Object.fromEntries(e)}function a(o,e){if(o.deeplink){let t={};t[o.deeplink]=e,U(t)}}function U(o){let e=new URLSearchParams(window.location.hash.slice(1));Object.entries(o).forEach(([i,c])=>{c?e.set(i,c):e.delete(i)}),e.sort();let t=e.toString();if(t===window.location.hash)return;let s=window.scrollY||document.documentElement.scrollTop;window.location.hash=t,window.scrollTo(0,s)}function R(o){let e=()=>{if(window.location.hash&&!window.location.hash.includes("="))return;let t=r(window.location.hash);o(t)};return e(),window.addEventListener(w,e),()=>{window.removeEventListener(w,e)}}var f=class extends G{get search(){return this.querySelector("sp-search")}constructor(){super(),this.handleInput=()=>{a(this,this.search.value),this.search.value&&this.dispatchEvent(new CustomEvent(T,{bubbles:!0,composed:!0,detail:{type:"search",value:this.search.value}}))},this.handleInputDebounced=E(this.handleInput.bind(this))}connectedCallback(){super.connectedCallback(),this.search&&(this.search.addEventListener("input",this.handleInputDebounced),this.search.addEventListener("submit",this.handleInputSubmit),this.updateComplete.then(()=>{this.setStateFromURL()}),this.startDeeplink())}disconnectedCallback(){super.disconnectedCallback(),this.search.removeEventListener("input",this.handleInputDebounced),this.search.removeEventListener("submit",this.handleInputSubmit),this.stopDeeplink?.()}setStateFromURL(){let t=r()[this.deeplink];t&&(this.search.value=t)}startDeeplink(){this.stopDeeplink=R(({search:e})=>{this.search.value=e??""})}handleInputSubmit(e){e.preventDefault()}render(){return B`<slot></slot>`}};n(f,"properties",{deeplink:{type:String}});customElements.define("merch-search",f);import{html as L,LitElement as $,css as q}from"/libs/deps/lit-all.min.js";var d=class extends ${constructor(){super(),this.handleClickDebounced=E(this.handleClick.bind(this))}selectElement(e,t=!0){e.parentNode.tagName==="SP-SIDENAV-ITEM"&&this.selectElement(e.parentNode,!1),t&&(this.selectedElement=e,this.selectedText=e.label,this.selectedValue=e.value,setTimeout(()=>{e.selected=!0},1),this.dispatchEvent(new CustomEvent(y,{bubbles:!0,composed:!0,detail:{type:"sidenav",value:this.selectedValue,elt:this.selectedElement}})))}setStateFromURL(){let t=r()[this.deeplink]??"all";if(t){let s=this.querySelector(`sp-sidenav-item[value="${t}"]`);if(!s)return;this.updateComplete.then(()=>{s.firstElementChild?.tagName==="SP-SIDENAV-ITEM"&&(s.expanded=!0),this.selectElement(s)})}}handleClick({target:e}){let{value:t,parentNode:s}=e;this.selectElement(e),s&&s.tagName==="SP-SIDENAV"&&(a(this,t),e.selected=!0,s.querySelectorAll("sp-sidenav-item[expanded],sp-sidenav-item[selected]").forEach(i=>{i.value!==t&&(i.expanded=!1,i.selected=!1)}))}selectionChanged({target:{value:e,parentNode:t}}){this.selectElement(this.querySelector(`sp-sidenav-item[value="${e}"]`)),a(this,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClickDebounced),this.updateComplete.then(()=>{this.setStateFromURL()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClickDebounced)}render(){return L`<div
aria-label="${this.label}"
@change="${e=>this.selectionChanged(e)}"
>
${this.sidenavListTitle?R`<h2>${this.sidenavListTitle}</h2>`:""}
${this.sidenavListTitle?L`<h2>${this.sidenavListTitle}</h2>`:""}
<slot></slot>
</div>`}};i(l,"properties",{sidenavListTitle:{type:String},label:{type:String},deeplink:{type:String,attribute:"deeplink"},selectedText:{type:String,reflect:!0,attribute:"selected-text"},selectedValue:{type:String,reflect:!0,attribute:"selected-value"}}),i(l,"styles",[G`
</div>`}};n(d,"properties",{sidenavListTitle:{type:String},label:{type:String},deeplink:{type:String,attribute:"deeplink"},selectedText:{type:String,reflect:!0,attribute:"selected-text"},selectedValue:{type:String,reflect:!0,attribute:"selected-value"}}),n(d,"styles",[q`
:host {
display: block;
contain: content;
Expand All @@ -36,15 +36,15 @@ var I=Object.defineProperty;var v=o=>{throw TypeError(o)};var V=(o,e,t)=>e in o?
)
);
}
`,u]);customElements.define("merch-sidenav-list",l);import{html as $,LitElement as q,css as Y}from"/libs/deps/lit-all.min.js";var d=class extends q{setStateFromURL(){this.selectedValues=[];let{types:e}=r();e&&(this.selectedValues=e.split(","),this.selectedValues.forEach(t=>{let s=this.querySelector(`sp-checkbox[name=${t}]`);s&&(s.checked=!0)}))}selectionChanged(e){let{target:t}=e,s=t.getAttribute("name");if(s){let n=this.selectedValues.indexOf(s);t.checked&&n===-1?this.selectedValues.push(s):!t.checked&&n>=0&&this.selectedValues.splice(n,1)}a(this,this.selectedValues.join(","))}connectedCallback(){super.connectedCallback(),this.updateComplete.then(async()=>{this.setStateFromURL()})}render(){return $`<div aria-label="${this.label}">
`,u]);customElements.define("merch-sidenav-list",d);import{html as Y,LitElement as K,css as W}from"/libs/deps/lit-all.min.js";var h=class extends K{setStateFromURL(){this.selectedValues=[];let{types:e}=r();e&&(this.selectedValues=e.split(","),this.selectedValues.forEach(t=>{let s=this.querySelector(`sp-checkbox[name=${t}]`);s&&(s.checked=!0)}))}selectionChanged(e){let{target:t}=e,s=t.getAttribute("name");if(s){let i=this.selectedValues.indexOf(s);t.checked&&i===-1?this.selectedValues.push(s):!t.checked&&i>=0&&this.selectedValues.splice(i,1)}a(this,this.selectedValues.join(","))}addAccessibilityAttributes(){let e="sidenav-checkbox-group-title",t=C("div",{class:"invisible-and-shrank",id:e});t.textContent=this.sidenavCheckboxTitle,this.append(t),this.querySelectorAll("sp-checkbox").forEach(s=>{s.setAttribute("role","group"),s.setAttribute("aria-labelledby",e)})}connectedCallback(){super.connectedCallback(),this.updateComplete.then(async()=>{this.setStateFromURL(),this.addAccessibilityAttributes()})}render(){return Y`<div aria-label="${this.label}">
<h3>${this.sidenavCheckboxTitle}</h3>
<div
@change="${e=>this.selectionChanged(e)}"
class="checkbox-group"
>
<slot></slot>
</div>
</div>`}};i(d,"properties",{sidenavCheckboxTitle:{type:String},label:{type:String},deeplink:{type:String},selectedValues:{type:Array,reflect:!0},value:{type:String}}),i(d,"styles",Y`
</div>`}};n(h,"properties",{sidenavCheckboxTitle:{type:String},label:{type:String},deeplink:{type:String},selectedValues:{type:Array,reflect:!0},value:{type:String}}),n(h,"styles",W`
:host {
display: block;
contain: content;
Expand All @@ -66,7 +66,7 @@ var I=Object.defineProperty;var v=o=>{throw TypeError(o)};var V=(o,e,t)=>e in o?
display: flex;
flex-direction: column;
}
`);customElements.define("merch-sidenav-checkbox-group",d);var L="(max-width: 700px)";var N="(max-width: 1199px)";var D=/iP(ad|hone|od)/.test(window?.navigator?.platform)||window?.navigator?.platform==="MacIntel"&&window.navigator.maxTouchPoints>1,_=!1,x,k=o=>{o&&(D?(document.body.style.position="fixed",o.ontouchmove=e=>{e.targetTouches.length===1&&e.stopPropagation()},_||(document.addEventListener("touchmove",e=>e.preventDefault()),_=!0)):(x=document.body.style.overflow,document.body.style.overflow="hidden"))},O=o=>{o&&(D?(o.ontouchstart=null,o.ontouchmove=null,document.body.style.position="",document.removeEventListener("touchmove",e=>e.preventDefault()),_=!1):x!==void 0&&(document.body.style.overflow=x,x=void 0))};var p,h=class extends W{constructor(){super();b(this,p);i(this,"mobileDevice",new c(this,L));i(this,"mobileAndTablet",new c(this,N));this.modal=!1}get filters(){return this.querySelector("merch-sidenav-list")}get search(){return this.querySelector("merch-search")}render(){return this.mobileAndTablet.matches?this.asDialog:this.asAside}get asDialog(){if(this.modal)return M`
`);customElements.define("merch-sidenav-checkbox-group",h);var N="(max-width: 700px)";var D="(max-width: 1199px)";var k=/iP(ad|hone|od)/.test(window?.navigator?.platform)||window?.navigator?.platform==="MacIntel"&&window.navigator.maxTouchPoints>1,_=!1,x,O=o=>{o&&(k?(document.body.style.position="fixed",o.ontouchmove=e=>{e.targetTouches.length===1&&e.stopPropagation()},_||(document.addEventListener("touchmove",e=>e.preventDefault()),_=!0)):(x=document.body.style.overflow,document.body.style.overflow="hidden"))},I=o=>{o&&(k?(o.ontouchstart=null,o.ontouchmove=null,document.body.style.position="",document.removeEventListener("touchmove",e=>e.preventDefault()),_=!1):x!==void 0&&(document.body.style.overflow=x,x=void 0))};var m,p=class extends z{constructor(){super();S(this,m);n(this,"mobileDevice",new l(this,N));n(this,"mobileAndTablet",new l(this,D));this.modal=!1}get filters(){return this.querySelector("merch-sidenav-list")}get search(){return this.querySelector("merch-search")}render(){return this.mobileAndTablet.matches?this.asDialog:this.asAside}get asDialog(){if(this.modal)return M`
<sp-theme color="light" scale="medium">
<sp-dialog-base
slot="click-content"
Expand All @@ -90,7 +90,7 @@ var I=Object.defineProperty;var v=o=>{throw TypeError(o)};var V=(o,e,t)=>e in o?
`}get asAside(){return M`<sp-theme color="light" scale="medium"
><h2>${this.sidenavTitle}</h2>
<slot></slot
></sp-theme>`}get dialog(){return this.shadowRoot.querySelector("sp-dialog-base")}closeModal(t){t.preventDefault(),this.dialog?.close(),document.body.classList.remove("merch-modal")}openModal(){this.updateComplete.then(async()=>{k(this.dialog),document.body.classList.add("merch-modal");let t={trigger:S(this,p),notImmediatelyClosable:!0,type:"auto"},s=await window.__merch__spectrum_Overlay.open(this.dialog,t);s.addEventListener("close",()=>{this.modal=!1,document.body.classList.remove("merch-modal"),O(this.dialog)}),this.shadowRoot.querySelector("sp-theme").append(s)})}updated(){this.modal&&this.openModal()}showModal({target:t}){C(this,p,t),this.modal=!0}};p=new WeakMap,i(h,"properties",{sidenavTitle:{type:String},closeText:{type:String,attribute:"close-text"},modal:{type:Boolean,attribute:"modal",reflect:!0}}),i(h,"styles",[K`
></sp-theme>`}get dialog(){return this.shadowRoot.querySelector("sp-dialog-base")}closeModal(t){t.preventDefault(),this.dialog?.close(),document.body.classList.remove("merch-modal")}openModal(){this.updateComplete.then(async()=>{O(this.dialog),document.body.classList.add("merch-modal");let t={trigger:b(this,m),notImmediatelyClosable:!0,type:"auto"},s=await window.__merch__spectrum_Overlay.open(this.dialog,t);s.addEventListener("close",()=>{this.modal=!1,document.body.classList.remove("merch-modal"),I(this.dialog)}),this.shadowRoot.querySelector("sp-theme").append(s)})}updated(){this.modal&&this.openModal()}showModal({target:t}){A(this,m,t),this.modal=!0}};m=new WeakMap,n(p,"properties",{sidenavTitle:{type:String},closeText:{type:String,attribute:"close-text"},modal:{type:Boolean,attribute:"modal",reflect:!0}}),n(p,"styles",[j`
:host {
display: block;
z-index: 2;
Expand Down Expand Up @@ -139,4 +139,4 @@ var I=Object.defineProperty;var v=o=>{throw TypeError(o)};var V=(o,e,t)=>e in o?
top: 16px;
right: 16px;
}
`,u]);customElements.define("merch-sidenav",h);export{h as MerchSideNav};
`,u]);customElements.define("merch-sidenav",p);export{p as MerchSideNav};
9 changes: 9 additions & 0 deletions libs/features/mas/dist/mas.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions libs/features/mas/src/global.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,5 +420,14 @@ body.merch-modal {
height: 100vh;
}

.invisible-and-shrank {
top: 0;
left: -2px;
width: 1px;
height: 1px;
position: absolute;
overflow: hidden;
}

`;
document.head.appendChild(styles);
13 changes: 13 additions & 0 deletions libs/features/mas/src/sidenav/merch-sidenav-checkbox-group.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { html, LitElement, css } from 'lit';
import { parseState, pushStateFromComponent } from '../deeplink.js';
import { createTag } from '../utils.js';

export class MerchSidenavCheckboxGroup extends LitElement {
static properties = {
Expand Down Expand Up @@ -69,10 +70,22 @@ export class MerchSidenavCheckboxGroup extends LitElement {
pushStateFromComponent(this, this.selectedValues.join(','));
}

addAccessibilityAttributes() {
const id = 'sidenav-checkbox-group-title';
const groupIdEl = createTag('div', { class: 'invisible-and-shrank', id });
groupIdEl.textContent = this.sidenavCheckboxTitle;
this.append(groupIdEl);
this.querySelectorAll('sp-checkbox').forEach((checkboxEl) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not sure i like the idea of merch-sidenav-checkbox-group being bound to sp-checkbox.
can't we add this 'role' attribute when we create those 'sp-checkboxes'? https://github.com/adobecom/cc/blob/stage/creativecloud/blocks/sidenav/sidenav.js#L79
I understand it means we need to rely on some stable id, so not sure if its better or not. maybe a bit less confusing for devs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and same with groupIdEl element, it could be probably created by sidenav block
@npeltier @yesil wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the JIRA recommends a few options, but can we try the OOTB SWC approach with sp-field-group
https://opensource.adobe.com/spectrum-web-components/components/field-group/

image

Before implementing this solution, the accessibility tool can be run against checkboxes in the SWC documentation

image
if it doesn't complain we can follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yesil I tried your idea directly on catalog page
Screenshot 2025-01-27 at 12 48 10
it doesn't work. :( Screen reader ignores the word "Types" although it is there twice, once in element "label" and once in attribute "label"

@3ch023 we had this in CC code before but then it was requested to move to Milo

@npeltier I can move that "types" element from shadow to light dom but again I need to iterate through checkboxes to set attributes 'aria-labelledby', and that is where Mariia complains about

So, option A : I do it in CC code in sidenav.js, I move the H3 element from shadow to light dom
option B : I do the same thing in milo code
For both options one reviewer will not be happy.

@3ch023 I could also try to iterate through direct children of merch-sidenav-checkbox-group, without bounding to sp-checkbox, in that case it would be OK to do it in Milo code, right? I think that is the only solution where everyone is happy. Let me try.

Copy link
Contributor

@3ch023 3ch023 Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with any solution you pick, its just the current one looked 'hacked' to me. and i wonder if there is a better way. (first sidenav block creates elements, then checkout-group modifies it's children and itself)
I've read @npeltier new suggestion a few times and didn't understand it still

checkboxEl.setAttribute('role', 'group');
checkboxEl.setAttribute('aria-labelledby', id);
});
}

connectedCallback() {
super.connectedCallback();
this.updateComplete.then(async () => {
this.setStateFromURL();
this.addAccessibilityAttributes();
});
}

Expand Down
Loading