Fix unable to set progress value to 0#2757
Merged
Merged
Conversation
|
Size Change: +64 B (0%) Total Size: 40.8 kB
ℹ️ View Unchanged
|
JoviDeCroock
approved these changes
Sep 19, 2020
510961a to
386b1c2
Compare
386b1c2 to
54c006d
Compare
| // despite the attribute not being present. When the attribute | ||
| // is missing the progress bar is treated as indeterminate. | ||
| // To fix that we'll always update it when it is 0 for progress elements | ||
| (i !== dom.value || (newVNode.type === 'progress' && !i)) |
Member
Author
There was a problem hiding this comment.
Turns out my previous fix of doing !dom.hasAttribute('value') is not a good one as it leads to all input values always being updated. The new fix only updates it, despite dom.value === props.value when the value is 0 for progress elements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to a weird oddity in the DOM interface the value
0is only treated as0when thevalueattribute is present. When the value is not present the progress bar is treated as being indeterminate. But the problem is that the DOM interface will always have all properties and the initial value forvalueis 0. This mismatch caused us to never set the progress bar value to0Fixes #2756 .