Open Bug 1566893 Opened 5 years ago Updated 2 years ago

Number input fails validation if javascript changes it to a valid value

Categories

(Core :: DOM: Core & HTML, defect, P3)

70 Branch
defect

Tracking

()

Tracking Status
firefox70 --- affected

People

(Reporter: brunoaiss, Unassigned)

Details

Attachments

(3 files)

If a number input is loaded with its value input containing an invalid value, that value is correctly corrected when it is presented to the user.

But then, if javascript goes changes the HTMLInputElement's value to a valid value (and keeping the tag's value attribute an invalid value), the input gets red for being invalid, although the value is actually valid.

See the attached page for an example.

Here's the counter-part that doesn't display the bug.
I uploaded to show the change that activates the bug.

Did I set this ticket correctly?

Flags: needinfo?(htsai)

(In reply to brunoais from comment #2)

Did I set this ticket correctly?

Yes, you're awesome, thank you.
I'll change the priority to default so it will fall into our radar for regular bug triage. Thank you again.

Flags: needinfo?(htsai)
Priority: P2 → --

(In reply to Hsin-Yi Tsai [:hsinyi] from comment #3)

(In reply to brunoais from comment #2)

Did I set this ticket correctly?

Yes, you're awesome, thank you.
I'll change the priority to default so it will fall into our radar for regular bug triage. Thank you again.

You're welcome. Thank you for <24h answer.
Next time I'll take into account and keep the P unset.

Could reproduce this on Ubuntu 18.04. Also with simplified default value of "38.2" (doesn't happen for 38). Will first need to check what the spec states about this.

(In reply to brunoais from comment #4)

(In reply to Hsin-Yi Tsai [:hsinyi] from comment #3)

(In reply to brunoais from comment #2)

Did I set this ticket correctly?

Yes, you're awesome, thank you.
I'll change the priority to default so it will fall into our radar for regular bug triage. Thank you again.

You're welcome. Thank you for <24h answer.
Next time I'll take into account and keep the P unset.
That's the best!

Priority: -- → P3

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: normal → S3

Still behaving wrong.
However, the way it is wrong is different.

I change the value and even if I follow the help text, I still can't get the input to validate

Attachment #9298889 - Attachment description: Buys me a full day of meals! → Even if setting the value indicated, I'm rejected
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: