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

fix(VListItem): use item role when in a group #13126

Merged
merged 2 commits into from
Feb 18, 2021

Conversation

mattgrande
Copy link
Contributor

@mattgrande mattgrande commented Feb 17, 2021

Description

A listitem should not contain an aria-selected attribute, and a
listbox should only have options as children.

See also:

Motivation and Context

fixes #13125

How Has This Been Tested?

Unit tests have been run & updated as necessary.

As a note, some tests in calendar-with-events.spec.ts failed for me, so I updated them... but I'm unsure why they would've failed, as my change had nothing to do with time formatting. CI failed (unsurprisingly), so I've reverted this change.

In addition, this change was manually tested using NVDA.

Markup:

<template>
  <v-container>
    <!-- <v-list class="pa-0 mb-4"> -->
      <v-list-item-group color="primary" aria-label="some label">
        <v-subheader class="text-subtitle-1">
          <div class="mr-auto">Header</div>
          <div>Enable</div>
        </v-subheader>
        <v-list-item v-for="(item, i) in listItems" :key="i">
          <v-list-item-content>
            <v-list-item-title v-text="item.text"></v-list-item-title>
          </v-list-item-content>
          <v-list-item-action>
            <v-switch color="primary"
                      class="disable-events"
                      :aria-label="item.text"
                      value
                      input-value="true"
            ></v-switch>
          </v-list-item-action>
        </v-list-item>
      </v-list-item-group>
    <!-- </v-list> -->
  </v-container>
</template>

<script>
  export default {
    data: () => ({
      listItems: [
        { id: 1, text: 'Option A' },
        { id: 2, text: 'Option B' },
        { id: 3, text: 'Option C' },
        { id: 4, text: 'Option D' },
      ],
    }),
  }
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@KaelWD KaelWD merged commit 4974d74 into vuetifyjs:master Feb 18, 2021
@KaelWD KaelWD changed the title fix(VListItem): fix aria role issue fix(VListItem): use item role when in a group Feb 18, 2021
@mattgrande mattgrande deleted the fix/13125-v-list-item-aria-role branch February 18, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Incorrect aria roles assigned to v-list-item
2 participants