Skip to content

Conversation

Haviles04
Copy link
Contributor

@Haviles04 Haviles04 commented Sep 18, 2025

Description

Fixes #22061
Addresses #22071

Markup:

<template>
  <v-app>
    <v-container class="d-flex flex-column">
      <v-text-field v-model="msg" />
      <v-btn @click="onClick">Active Button</v-btn>
      <v-btn color="secondary" :disabled="true" @click="onClick">I'm real button!</v-btn>
      <v-btn color="primary" href="http://www.google.com" target="_blank" :disabled="true" @click="onClick">I'm a link!</v-btn>
    </v-container>
  </v-app>
</template>

<script setup>
import { ref } from 'vue'

const msg = ref('Hello World!')
const onClick = () => {
  console.log('hi');
}
</script>

@Haviles04 Haviles04 changed the title Fix(V-Btn): prevent disabled links from opening on focus + enter key fix(V-Btn): prevent disabled links from opening on focus + enter key Sep 18, 2025
@Haviles04 Haviles04 closed this Sep 18, 2025
@Haviles04 Haviles04 reopened this Sep 18, 2025
@Haviles04 Haviles04 requested review from KaelWD, J-Sek and a team September 18, 2025 13:39
@Haviles04 Haviles04 force-pushed the haviles04/v-btn-disabled-link-prevent-default branch from 22cb645 to 2738c1a Compare September 18, 2025 14:51
@Haviles04 Haviles04 changed the title fix(V-Btn): prevent disabled links from opening on focus + enter key fix(V-Btn): Add Aria-disabled and tab index to disabled anchor tags Sep 18, 2025
@Haviles04 Haviles04 force-pushed the haviles04/v-btn-disabled-link-prevent-default branch from 97fea38 to 3718fb5 Compare September 18, 2025 16:07
@J-Sek
Copy link
Contributor

J-Sek commented Sep 18, 2025

Would it be possible to consolidate this in router.tsx » linkProps so we can share this logic between VBtn, VChip, VCard and VListItem?

@Haviles04
Copy link
Contributor Author

Haviles04 commented Sep 18, 2025

Would it be possible to consolidate this in router.tsx » linkProps so we can share this logic between VBtn, VChip, VCard and VListItem?

Excellent idea, this is a much better solution!

@Haviles04 Haviles04 changed the title fix(V-Btn): Add Aria-disabled and tab index to disabled anchor tags fix(V-Btn): Add Aria-disabled and tab index to disabled links Sep 18, 2025
@johnleider johnleider added this to the v3.10.x milestone Sep 22, 2025
@KaelWD KaelWD changed the title fix(V-Btn): Add Aria-disabled and tab index to disabled links fix(VBtn): add aria-disabled and tabindex to disabled links Sep 23, 2025
@KaelWD KaelWD merged commit 6e92383 into master Sep 23, 2025
18 checks passed
@KaelWD KaelWD deleted the haviles04/v-btn-disabled-link-prevent-default branch September 23, 2025 07:38
@J-Sek
Copy link
Contributor

J-Sek commented Sep 23, 2025

❗ It took away tabindex="-2" from list items which seems to break navigation (arrow up/down) within lists (VSelect, VCombobox, VAutocomplete). @Haviles04

@Haviles04
Copy link
Contributor Author

❗ It took away tabindex="-2" from list items which seems to break navigation (arrow up/down) within lists (VSelect, VCombobox, VAutocomplete). @Haviles04

Lookin into this now

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][3.10.0] Disabled VBtn with href can still be focused and followed with the Enter key
4 participants