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 /> renders incorrectly depending on order of props in IE and Edge #15336

Closed
thomasmaqua opened this issue Apr 5, 2019 · 4 comments
Closed
Labels
Browser: IE Component: DOM Resolution: Stale Automatically closed due to inactivity

Comments

@thomasmaqua
Copy link

thomasmaqua commented Apr 5, 2019

Do you want to request a feature or report a bug?
A bug

What is the current behavior?
<progress value="50" max="100" /> renders with an initial value of 1 in IE and Edge
<progress max="100" value="50" /> correctly renders with an initial value of 50 in IE and Edge

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
https://jsfiddle.net/1utpfn5s/6/

What is the expected behavior?
I expect that the order of props supplied to <progress /> are irrelevant. In the example above, the initial value of the rendered <progress /> should be 50.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
At least IE11 and Edge (40) are affected. Chrome and Firefox work fine.

@thomasmaqua thomasmaqua changed the title progressbar renders incorrectly depending on order of props in IE and Edge <progress /> renders incorrectly depending on order of props in IE and Edge Apr 5, 2019
@kunukn
Copy link
Contributor

kunukn commented Apr 6, 2019

DOM Api bug for IE 11 happens when setAttribute order is first value then max. e.g.

// IE 11 - NOT ok
let progress =  document.createElement('progress');
progress.setAttribute('value', '50');
progress.setAttribute('max', '100');  
document.body.appendChild(progress);

// IE 11 - ok
progress =  document.createElement('progress');
progress.setAttribute('max', '100');  
progress.setAttribute('value', '50');
document.body.appendChild(progress);

DEMO (open with IE11)
https://s.codepen.io/kunukn/debug/a7daad478be400d637827c5d2ddd3381

Maybe the solution is to ensure that attribute max is applied first for the progress element?
If that is a breaking change and a no go, then maybe add a warning in development mode?

@quasicomputational
Copy link

I assume this is related to whatwg/html#2427, in which case the long-term solution is to fix the spec somehow and then get cross-browser compatibility with that.

@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@stale
Copy link

stale bot commented Jan 17, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser: IE Component: DOM Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants