Skip to content

Commit 3b4ffb6

Browse files
committed
refactor: change screen readers accessibility
1 parent 24a45a5 commit 3b4ffb6

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

src/components/Spinner/CSpinner.vue

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,31 @@ export default {
1010
tag: {
1111
type: String,
1212
default: 'span'
13-
},
14-
labelText: {
15-
type: String,
16-
default: 'Loading...'
1713
}
1814
},
19-
render(h, { props, data, slots }) {
20-
const label = h('span', { staticClass: 'c-sr-only' }, props.labelText)
15+
render(h, { props, data }) {
2116
const type = props.grow ? 'grow' : 'border'
2217
return h(
2318
props.tag,
2419
mergeData(data, {
2520
attrs: {
2621
role: 'status',
27-
'aria-hidden': label ? null : 'true'
22+
'aria-hidden': 'false',
23+
'aria-label': 'Loading'
2824
},
29-
class: [`c-spinner-${type}`,
30-
{
31-
[`c-spinner-${type}-sm`]: props.small,
32-
[`c-text-${props.variant}`]: Boolean(props.variant)
33-
}
34-
]
35-
}),
36-
[label]
25+
class: [
26+
`c-spinner-${type}`,
27+
{
28+
[`c-spinner-${type}-sm`]: props.small,
29+
[`c-text-${props.variant}`]: Boolean(props.variant)
30+
}
31+
]
32+
})
3733
)
3834
}
3935
}
4036
</script>
4137

4238
<style scoped lang="scss">
4339
@import "~@coreui/coreui/scss/partials/spinners.scss";
44-
@import "~@coreui/coreui/scss/utilities/_screenreaders.scss";
4540
</style>

0 commit comments

Comments
 (0)