Skip to content

Commit

Permalink
fix(Progress): pass down attrs to <progress> to improve accessibili…
Browse files Browse the repository at this point in the history
…ty (#1881)
  • Loading branch information
noook authored Jun 24, 2024
1 parent 0a47a2b commit abd13f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/runtime/components/elements/Progress.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="ui.wrapper" v-bind="attrs">
<div :class="ui.wrapper" role="progressbar">
<slot v-if="indicator || $slots.indicator" name="indicator" v-bind="{ percent }">
<div v-if="!isSteps" :class="indicatorContainerClass" :style="{ width: `${percent}%` }">
<div :class="indicatorClass">
Expand All @@ -8,7 +8,12 @@
</div>
</slot>

<progress :class="progressClass" v-bind="{ value, max: realMax }">
<progress
:aria-valuemax="realMax"
:aria-valuenow="value"
:class="progressClass"
v-bind="{ value, max: realMax, ...attrs }"
>
{{ percent !== undefined ? `${Math.round(percent)}%` : undefined }}
</progress>

Expand Down

0 comments on commit abd13f1

Please sign in to comment.