-
Notifications
You must be signed in to change notification settings - Fork 988
Open
Description
What is affected?
Component
Description
<input id="123" type="number" readOnly></input>
Default step value for this is "1". Now if you set this readOnly input in JS document.getElementById("123").value = "0.5" you'll get following:
input.reportValidity() = true
input.checkValidity() = true
BUT
input.validity Object will have "stepMismatch: true"
and
input.validationMessage = ''.
This seems to be a problem for material-web internal validation logic. It doesn't like a property of the validity object to be 'true' and an empty validationMessage at the same time.
Reproduction
create a number readOnly material web input and set its value to "0.5"
Workaround
Ensure all the inputs would be theoretically valid, although validation shouldn't be triggered in this case.
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
1.5.0
Browser/OS/Node environment
Chrome, Windows
Metadata
Metadata
Assignees
Labels
No labels