-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indicator on Progress Bar doesnt show true value (if value is over 100) #1234
Comments
@DarkGhostHunter Any hint on this? |
@benjamincanac just wanted to follow up on this. I see you are quite active on this repo 😊. Think that this should be done. To avoid this interfering with anyone's current use cases why don't we add a prop to set max and keep the default at 100? |
This was actually the default behaviour but this has been changed in #939. |
🤯 OMG. I beg to differ! Cant believe it. It maybe would have made sense that this should be default but think that value is value and shouldnt be messed with? Also, there are many use cases that going over 100 is a nessacity for example fundraising, workout training etc.. Is there any chance this can be "fixed"? |
Have you tried using the |
Thanks for your help. yip did try that. Also, check source code - it is force limited to realMax of 100. Just commented on this pull that you quoted. Maybe there is logic to this, but at this point unless it can be explained this this pr should be reverted? Am i wrong? |
@benjamincanac What would you suggest as a temporary fix for this? |
Like I said, I would use the <script setup>
const value = ref(110)
</script>
<template>
<UProgress :value="value" :max="100">
<template #indicator>
{{ value }}%
</template>
</UProgress>
</template> |
There is no point on getting the real value when inside the progress bar you already have access to the real value from outside. It's like: That's why I limited it to 100%. It's semantically correct for the value of the progress bar, NOT the value that comes to the progress bar (that could be 150). That's why the I consider this not a bug. |
Thanks of your time. This indicator doesn't follow the percentage. I.e. if the percentage is at 80 percent or 20% the indicator stays in the center - and doesnt follow as the percentage grows. So Yip doesnt really work - since to achieve this one could just put {{value}} on top of the uprogress. Thanks ❤️ |
Hi, Thanks! But as is explained when you use that slot the percentage does not follow the progress. So it is essentially just like putting {{value}} on top of it. See reproduction Not sure if i understand what you are explaining... |
You need to add a div with text-right class and set the width to the percentage of the progress. Then it will move with the bar.
|
Hi @maxsteinwand, Hope you well. Thanks for this! Do you think this should be default behavior of the slot? Since this does solve the issue. Appreicate it! |
Imo it should stay as is. The Indicator slot should be styleable all by yourself and not already move the text for you. |
Environment
Version
latest
Reproduction
<UProgress :value="150" indicator />
Description
When using UProgress sometimes values exceed 100, for example in the use case of raising money. Obviously it is arguable if there should be a max of more than 100. However, what seems definate like in BS5 and many other progress libs - the indicator should show the current value even if it is over 100.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: