Open Bug 1798833 Opened 3 years ago Updated 1 year ago

Checkbox state change is ignored on page reload

Categories

(Firefox :: Session Restore, defect)

defect

Tracking

()

Tracking Status
firefox-esr102 --- affected
firefox109 --- affected
firefox110 --- affected

People

(Reporter: styu007, Unassigned)

Details

(Keywords: dupeme)

Checkboxes are ignoring the checked state changes on page reloads even if the user didn't touch the checkbox. I understand that it is intended to overwrite the value set by the html attribute with the value the user was setting manually, but changes to the checkboxes checked property are being ignored even if the user didn't touch them at all. Currently, the checkboxes didn't respect changes on the backend between page reloads.

I think this overwrite should only happen after the user was touching the specific checkbox. The current behavior is very confusing, I have spent hours figuring out that it was caused by Firefox's behavior (which is different from webkit).

You can use autocomplete="off" to prevent this behavior, fwiw.

Thank you, I found it out, but it took me more than an hour as we are using a lot of javascript and I thought that our own code is causing the issue. It is just a very confusing behavior at the moment.
I forgot to mention that I may have clicked on the checkbox, so it may have triggered autocomplete to work on that checkbox, but we are using requestSubmit() on every change, so the form was already submitted when the checkbox was checked. I think autocomplete should reset its dirty flag on submit, even if it was happened with javascript. Other properties can easily affect the value of the checkbox on the backend, and then the wrong value is represented to the user.

The severity field is not set for this bug.
:TYLin, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(aethanyc)

It looks like https://stackoverflow.com/questions/299811/why-does-the-checkbox-stay-checked-when-reloading-the-page might be describing the same compat issue (vs. WebKit).

Also, I think this is more about the state of the checkbox than its layout/presentation, so this probably belongs in DOM:Forms; reclassifying.

Component: Layout: Form Controls → DOM: Forms
Flags: needinfo?(aethanyc)
Component: DOM: Forms → Session Restore
Product: Core → Firefox

The severity field is not set for this bug.
:dao, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dao+bmo)

I've managed to reproduce this issue using the example given in ticket https://stackoverflow.com/questions/299811/why-does-the-checkbox-stay-checked-when-reloading-the-page(from Comment 4) on the latest versions Nightly 111.0a1 and Firefox 109.0 on Windows 10 x64.
Setting as NEW.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(dao+bmo)
Keywords: dupeme
You need to log in before you can comment on or make changes to this bug.