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(VTab): disabled tab can be reached by keyboard #14606

Merged
merged 1 commit into from Jan 25, 2022

Conversation

TheoPez
Copy link
Contributor

@TheoPez TheoPez commented Jan 13, 2022

Description

If vTab is disabled I set the tabindex to -1, means that the element is not reachable via sequential keyboard navigation.
fixes #14601

Motivation and Context

This PR solves the problem present on the vTab component which can be focused by the keyboard even if is disabled.
(see the reproduction in #14601)

How Has This Been Tested?

Markup:

<template>
  <v-container>
    <v-switch v-model="disableTab" label="Enable/Disable tab #3"></v-switch>
    <v-tabs>
      <v-tab>Item One</v-tab>
      <v-tab>Item Two</v-tab>
      <v-tab :disabled="disableTab">Item Three</v-tab>
      <v-tab>Item Four</v-tab>


      <v-tab-item>1</v-tab-item>
      <v-tab-item>2</v-tab-item>
      <v-tab-item >3</v-tab-item>
      <v-tab-item >4</v-tab-item>
    </v-tabs>
  </v-container>
</template>

<script>
  export default {
    data: () => ({
      disableTab: true
    })
  }
</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)

@TheoPez TheoPez changed the title fix(Vtab): Disabled tab can be reached by keyboard fix(Vtab): Disabled vTab can be reached by keyboard Jan 15, 2022
@KaelWD KaelWD changed the title fix(Vtab): Disabled vTab can be reached by keyboard fix(VTab): disabled tab can be reached by keyboard Jan 25, 2022
@KaelWD KaelWD merged commit d110f58 into vuetifyjs:master Jan 25, 2022
@TheoPez TheoPez deleted the 14601-disabled-tab-can-be-reached branch January 25, 2022 13:28
@KaelWD KaelWD mentioned this pull request Apr 11, 2022
8 tasks
@KaelWD KaelWD added this to the v2.6.x milestone Aug 5, 2022
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][2.6.2] Disabled tab can be reached by keyboard
2 participants