Skip to content

Commit

Permalink
Fixed the display of the progress bar with 0 value
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyjamer committed Jan 9, 2025
1 parent 00646eb commit 2976b07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
label-progress
label="Flowbite Vue 3"
/>

<div class="mb-4" />

<fwb-progress
:progress="0"
label-position="outside"
label-progress
label="Flowbite Vue 3"
/>
</template>

<script setup>
Expand Down
5 changes: 5 additions & 0 deletions src/components/FwbProgress/FwbProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class="w-full bg-gray-200 rounded-full dark:bg-gray-700"
>
<div
v-if="displayBar"
:class="innerClasses"
:style="{ width: safeProgress + '%' }"
class="rounded-full font-medium text-blue-100 text-center p-0.5 min-w-max box-border"
Expand Down Expand Up @@ -65,6 +66,10 @@ const safeProgress = computed(() => {
return props.progress <= size ? size : props.progress
})
const displayBar = computed(() => {
return props.labelPosition === 'inside' || props.progress > 0
})
const {
innerClasses,
outerClasses,
Expand Down

0 comments on commit 2976b07

Please sign in to comment.