ember-power-select icon indicating copy to clipboard operation
ember-power-select copied to clipboard

Ensure multiple select <ul> has only <li> children

Open mydea opened this issue 5 years ago • 3 comments
trafficstars

ember-a11y-testing (or more specifically, axe) complains that a <ul> has to have <li> children only. This PR slightly changes the DOM structure of the multi-select trigger to accomodate that.

I have tried it, and it should look/feel/behave the same!

mydea avatar Dec 04 '19 08:12 mydea

I'll pull the PR and investigate if there's a less breaking way of achieving the same thing, but I agree with the idea. I want this to be part of v4

cibernox avatar Dec 04 '19 13:12 cibernox

Awesome! Yeah, I have also looked a bit around. Another idea would be to simply replace the <ul> and <li> with <div> - also not sure if that would otherwise negatively impact the accessibility...!

mydea avatar Dec 04 '19 13:12 mydea

Can this be moved along, too?

MarcoZehe avatar May 28 '20 06:05 MarcoZehe

@mydea is there any possibility of this being a breaking change? Especially if people were styling assuming the li was not there?

RobbieTheWagner avatar Sep 07 '22 13:09 RobbieTheWagner

It's possible, yes! But I would say rather unlikely, e.g. if you relied on ul > .ember-power-select-placeholder it would break, I guess.

I guess the biggest potentially breaking change is that the container (.ember-power-select-multiple-options) has display: flex, which could affect styling. Not sure what guarantees there are about this internal markup!

(Breaking in the sense of visually breaking in some way)

mydea avatar Sep 07 '22 13:09 mydea

It was a breaking change for our styling, because the precompiled css is not updated: https://github.com/cibernox/ember-power-select/issues/1586

Also broke a unit test which checked for the presence of a single <li element for the selected option, but there are now 2.

Not sure this actually improves a11y, it just satisfies a linting rule. The <input field should probably exist outside of the <ul list, no?

gvdp avatar Jul 10 '23 13:07 gvdp