Skip to content
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

va-progress-bar won't locate the default slot inside itself even if there's enough space for it #1985

Closed
smellyshovel opened this issue Jun 22, 2022 · 1 comment · Fixed by #2027
Assignees
Labels
external Reported by external contributor and handled with priority feature Something useful to end user
Milestone

Comments

@smellyshovel
Copy link
Member

smellyshovel commented Jun 22, 2022

image

Per @RVitaly1978

Currently there are two scenarious for the default's slot behavior for the progress bar. It either is located inside the bar, or above it.

The idea is that if it's possible to fit the slot inside the bar, then it should go there, but if the slot won't fit there (as in case with small- and medium-sized bars), it goes above the bar.

Though the issue is that currently the only possible way to locate the slot inside the bar is to set the bar's size property to large. And, as you can see from the screenshot above, when you use some custom size (like 2rem) which is definitely larger than the large size, the slot won't go inside the bar. But ideally it should.

AFAICS, there exist 2 potential solutions for this issue:

  1. Universal, but clutchy and tricky to implement and support: render the bar first, find its actual rendered size and compare it to the slot's rendered size. If the slot's size is smaller than the bar's size, fit the slot inside. Otherwise, put it on top.
  2. The second solution is to provide a new prop, something like boolean slot-inside, which tells wheher it's a good idea for Vuestic to try to fit the slot inside the bar instead of locating it above the progress bar (which is, again, the default and the current behavior).

I personally like the 2nd approach more, though there's a fine line between over-implementing things and providing a lot of freedom for the developers. In other words, such a prop might be an overkill. Please, share your thoughts on the topic.

@smellyshovel smellyshovel added feature Something useful to end user external Reported by external contributor and handled with priority labels Jun 22, 2022
@smellyshovel
Copy link
Member Author

Dicided to create a prop. The name for it is still under consideration though.

@m0ksem m0ksem added this to the 1.4.5 (current) milestone Jun 27, 2022
@RVitaly1978 RVitaly1978 self-assigned this Jun 29, 2022
RVitaly1978 added a commit that referenced this issue Jun 30, 2022
* fix: add slot-inside prop

* fix: update examples

* fix: update locales

* fix: rename prop

* feat: add show-percent prop

* fix: update examples and locales

* minor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Reported by external contributor and handled with priority feature Something useful to end user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants