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

<progress> bar rounding cut off when max != 100 #19065

Closed
bschaeffer opened this issue Feb 2, 2016 · 13 comments
Closed

<progress> bar rounding cut off when max != 100 #19065

bschaeffer opened this issue Feb 2, 2016 · 13 comments

Comments

@bschaeffer
Copy link

When a <progress> element's max attributes is over 100, the rounding is cutoff.

For me, this issue popped up when I was displaying progress bars in a table.table element, but occurs outside of it as well. Here's an example:

http://www.bootply.com/X7zC8gJyLG

Example Image

Though most examples of progress elements on the web use a max value of 100, I could find no documentation that 100 is the max allowed value.

@twbs-lmvtfy
Copy link

Hi @bschaeffer!

You appear to have posted a live example (http://s.bootply.com/render/X7zC8gJyLG), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:

  • line 43, column 16 thru line 44, column 26: th start tag in table body.
  • line 52, column 17 thru column 55: Element div not allowed as child of element progress in this context. (Suppressing further errors from this subtree.)
  • line 64, column 17 thru column 55: Element div not allowed as child of element progress in this context. (Suppressing further errors from this subtree.)

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!

(Please note that this is a fully automated comment.)

@bschaeffer
Copy link
Author

Revised example: http://www.bootply.com/E0twbUEAoy

PS:

@twbs-lmvtfy
Copy link

Hi @bschaeffer!

You appear to have posted a live example (http://s.bootply.com/render/X7zC8gJyLG), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:

  • line 43, column 16 thru line 44, column 26: th start tag in table body.
  • line 52, column 17 thru column 55: Element div not allowed as child of element progress in this context. (Suppressing further errors from this subtree.)
  • line 64, column 17 thru column 55: Element div not allowed as child of element progress in this context. (Suppressing further errors from this subtree.)

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!

(Please note that this is a fully automated comment.)

@bschaeffer
Copy link
Author

@twbs-lmvtfy
Copy link

Hi @bschaeffer!

You appear to have posted a live example (http://s.bootply.com/render/E0twbUEAoy), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:

  • line 40, column 3: E003: Found one or more .rows that were not children of a grid column or descendants of a .container or .container-fluid
  • line 67, column 3: E003: Found one or more .rows that were not children of a grid column or descendants of a .container or .container-fluid
  • line 73, column 3: E003: Found one or more .rows that were not children of a grid column or descendants of a .container or .container-fluid

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!

(Please note that this is a fully automated comment.)

@bschaeffer
Copy link
Author

This is stupid

@wolfy1339
Copy link
Contributor

Fixed up example: http://www.bootply.com/HgDioZygC1

@cvrebert cvrebert changed the title Progress bar rounding cut off when max over 100 (v4) <progress> bar rounding cut off when max != 100 Feb 2, 2016
@cvrebert
Copy link
Collaborator

cvrebert commented Feb 2, 2016

Looks like the current code assumed that value was always a percentage and didn't account for max:

// Tweaks for full progress bar
.progress[value="100"]::-moz-progress-bar {
@include border-right-radius($border-radius);
}
.progress[value="100"]::-webkit-progress-value {
@include border-right-radius($border-radius);
}

Perhaps we should just always apply the border-radius regardless of the fill level?

@eliottrobson
Copy link

I think always applying it would be the best option. #18835 discusses the potential to stacking and the main discussion is, are we planning on bringing stacking progress bars back? If we are then the progress element itself becomes irrelevant because it's non supporting. Dropping support for stacking and always rounding has my vote.

@cvrebert
Copy link
Collaborator

cvrebert commented Feb 5, 2016

are we planning on bringing stacking progress bars back?

Probably. But that doesn't imply dropping support for <progress> for non-stacked bars.

@patrickhlauke
Copy link
Member

...just to point out that providing a sensible, live-updating and screenreader friendly way of providing stacked bars is...non-trivial ;)

@cvrebert
Copy link
Collaborator

cvrebert commented Feb 5, 2016

"Include a screenreader-only <table> with the same data, sprinkle with ARIA attributes, and pray to the dark god Cthua11yhu?" 😜

@patrickhlauke
Copy link
Member

heh, indeed. in seriousness, if it's only a stack of 3-4 different bars, it possibly best to make it a visually hidden live region that reads the whole thing as one short sentence ("foo: 10%; bar: 23%; baz: 92.4%") but once you have more separate elements, it starts getting really tricky...

@mdo mdo added this to the v4.0.0-alpha.6 milestone Nov 27, 2016
mdo added a commit that referenced this issue Nov 27, 2016
…; to properly round corners of a full progress bar.

Fixes #19065.
@mdo mdo added the has-pr label Nov 27, 2016
mdo added a commit that referenced this issue Nov 27, 2016
…; to properly round corners of a full progress bar. (#21216)

Fixes #19065.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants