Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-10286

Firefox form controls bahavior: state not reset after refresh

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None

      https://bugzilla.mozilla.org/show_bug.cgi?id=394782 (seems to be about a different issue although comments hint at this specific behavior)
      https://bugzilla.mozilla.org/show_bug.cgi?id=1459865 (closed as INVALID, intentional behavior)
      https://bugzilla.mozilla.org/show_bug.cgi?id=1456835 (closed as INVALID, intentional behavior)
      https://bugzilla.mozilla.org/show_bug.cgi?id=654072 (Lengthy discussion)

      https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#checked

      Unlike other browsers, Firefox by default persists the dynamic checked state of an <input> across page loads.

      From IRC (#musicbrainz):

      <chaban> Was about to migrate back to Firefox and then this bug occurs: https://bugzilla.mozilla.org/show_bug.cgi?id=394782
      <chaban> Voting mistake already happened: https://musicbrainz.org/edit/62633580
      <chaban> Tried disabling autofill and session restore. Still happens
      <chaban> Looks like the only solution is for the site to add autocomplete=off to forms: http://www.ryancramer.com/journal/entries/radio_buttons_firefox/

      More from IRC (ca. 1.5 years later):
      https://chatlogs.metabrainz.org/brainzbot/musicbrainz/2021-02-04/?msg=4738460&page=2

      Steps to reproduce:

      1. Vote on any edit
      2. Select any radio button that has not the checked attribute
      3. Refresh the page with CTRL+R or F5

      Note: this doesn't happen when force refreshing the page with CTRL+SHIFT+R or CTRL+F5

      Expected results:

      Radio button with checked attribute is selected on refresh.

      Actual results:

      Radio button that was selected before refreshing the page is checked instead.

      Possible solution:

      Add autocomplete="off" to form tags.

      http://www.ryancramer.com/journal/entries/radio_buttons_firefox/

       
      Remarks:
      The specs don't seem clear which behavior is more desirable. Should a soft-refresh restore form input or not? There are many other people annoyed by Firefox's behavior (Won't link them, simply too many). IMHO it's better to reset forms on refresh. It can prevent unintended values when submitting the form.

      Settings I've tried:

       browser.cache.disk.enable;false
       browser.cache.disk_cache_ssl;false
       browser.formfill.enable;false
       signon.autofillForms;false
       signon.formlessCapture.enabled;false
       signon.rememberSignons;false
       signon.storeWhenAutocompleteOff;false
       browser.cache.memory.enable;false
       browser.sessionhistory.max_entries;0
       places.history.enabled;false
      

      https://html.spec.whatwg.org/multipage/input.html#the-input-element:the-input-element-4
      https://html.spec.whatwg.org/multipage/input.html#radio-button-state-(type=radio)
      https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-control-infrastructure
      https://html.spec.whatwg.org/multipage/input.html#common-input-element-events

            Unassigned Unassigned
            chaban chaban
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package