Skip to content

Commit 6e92383

Browse files
authored
fix(VBtn): add aria-disabled and tabindex to disabled links (#22082)
Fixes #22061
1 parent 807cbc8 commit 6e92383

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/vuetify/src/components/VBtn/VBtn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export const VBtn = genericComponent<VBtnSlots>()({
225225
props.style,
226226
]}
227227
aria-busy={ props.loading ? true : undefined }
228-
disabled={ isDisabled.value || undefined }
228+
disabled={ (isDisabled.value && Tag !== 'a') || undefined }
229229
tabindex={ props.loading || props.readonly ? -1 : undefined }
230230
onClick={ onClick }
231231
value={ valueAttr.value }

packages/vuetify/src/composables/router.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface LinkProps {
3535
replace: boolean | undefined
3636
to: RouteLocationRaw | undefined
3737
exact: boolean | undefined
38+
disabled: boolean | undefined
3839
}
3940

4041
export interface LinkListeners {
@@ -98,6 +99,8 @@ export function useLink (props: LinkProps & LinkListeners, attrs: SetupContext['
9899
linkProps: reactive({
99100
href,
100101
'aria-current': toRef(() => isActive.value ? 'page' : undefined),
102+
'aria-disabled': toRef(() => props.disabled && isLink.value ? 'true' : undefined),
103+
tabindex: toRef(() => props.disabled && isLink.value ? '-1' : undefined),
101104
}),
102105
}
103106
}

0 commit comments

Comments
 (0)