Skip to content

Commit 867b2ab

Browse files
committed
fix(VSkeletonLoader): remove aria-label when loading finished
1 parent 48ca6ea commit 867b2ab

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/api-generator/src/locale/en/VSkeletonLoader.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"props": {
33
"boilerplate": "Remove the loading animation from the skeleton.",
44
"loading": "Applies a loading animation with a on-hover loading cursor. A value of **false** will only work when there is content in the `default` slot.",
5+
"loadingText": "aria-label for the element in a loading state.",
56
"type": "A string delimited list of skeleton components to create such as `type=\"text@3\"` or `type=\"card, list-item\"`. Will recursively generate a corresponding skeleton from the provided string. Also supports short-hand for multiple elements such as **article@3** and **paragraph@2** which will generate 3 _article_ skeletons and 2 _paragraph_ skeletons. Please see below for a list of available pre-defined options.",
67
"types": "A custom types object that will be combined with the pre-defined options. For a list of available pre-defined options, see the **type** prop."
78
}

packages/vuetify/src/components/VSkeletonLoader/VSkeletonLoader.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ export const VSkeletonLoader = genericComponent()({
143143

144144
useRender(() => {
145145
const isLoading = !slots.default || props.loading
146+
const loadingProps = (props.boilerplate || !isLoading) ? {} : {
147+
ariaLive: 'polite',
148+
ariaLabel: t(props.loadingText),
149+
role: 'alert',
150+
}
146151

147152
return (
148153
<div
@@ -159,10 +164,7 @@ export const VSkeletonLoader = genericComponent()({
159164
backgroundColorStyles.value,
160165
isLoading ? dimensionStyles.value : {},
161166
]}
162-
aria-busy={ !props.boilerplate ? isLoading : undefined }
163-
aria-live={ !props.boilerplate ? 'polite' : undefined }
164-
aria-label={ !props.boilerplate ? t(props.loadingText) : undefined }
165-
role={ !props.boilerplate ? 'alert' : undefined }
167+
{ ...loadingProps }
166168
>
167169
{ isLoading ? items.value : slots.default?.() }
168170
</div>

0 commit comments

Comments
 (0)