Home > Software design >  How can I prevent this from running on my screen reader when input is empty?
How can I prevent this from running on my screen reader when input is empty?

Time:09-29

I'm learning about vue and aria, i have an input where you can write names and it will expand a list with certain number of people. I want my screenreader don't show the people based on the lenght, i want make it so when you delete all the letters the screenreader reads ' ' I have this line <span class="sr-only" v-if:"filterCities.length > 0" :aria-label=" 'Showing ' filterCities.length ' results'"></span>

I'm sure i'm not doing it right with the v-if: since VS CODE says 'v-if directives require no modifer, require that attribute value. What does it exactly mean? can someone help me please?

CodePudding user response:

It should be v-if="v-if="filterCities.length > 0" with an equal.

   <span class="sr-only" v-if="filterCities.length > 0" :aria-label=" 'Showing ' filterCities.length   ' results'"></span>
  • Related