Subscribe on changes!

Add aria-roles on v-model

avatar
Oct 24th 2022

What problem does this feature solve?

In a web component built with aria-roles, for example with this template :

<span
  role="checkbox"
  aria-checked="false"
  tabindex="0"
  aria-labelledby="chk1-label"></span>
<label id="chk1-label">Remember my preferences</label>

input binding with v-model does not work.

What does the proposed API look like?

Now :

<input type="checkbox"> and <input type="radio"> use checked property and change event

Wanted :

<custom-element role="checkbox"> and <custom-element role="radio"> use checked (or aria-checked) property and change event;

role="checkbox" can be in the light or shadow dom.

avatar
Oct 24th 2022

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.

avatar
Oct 25th 2022

Hi, I don't understand, I think it's a feature resquest, because today v-model only works with input type="checkbox", and I think it should work with aria-roles.

avatar
Oct 25th 2022

aria roles, like other attributes, are to be set manually with v-bind. This kind of abstraction belongs in a component (e.g. component libraries add these attributes) to catter for all possible use cases