<select> tag <option> selected attribute does not work correctly on page refresh

RESOLVED WORKSFORME

Status

()

Core
DOM: Core & HTML
RESOLVED WORKSFORME
8 months ago
2 months ago

People

(Reporter: flovro, Unassigned)

Tracking

45 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 months ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20170301181722

Steps to reproduce:

Load an html with a <select> box that does not have a pre-selected option. Then edit the html with adding "selected" to one of the <options>. Reload with either PF5 or by pressing an enter on the address bar.


Actual results:

When changing the <select> box by changing an <option> by adding "selected", if refreshed with PF5 or by pressing Enter on the address bar, the pre-selected option is not activated. When pressing CTRL-PF5, the pre-selected option is selected correcty.

In the page source the "selected" option is displayed.


Expected results:

If refreshing a page, the selected option should be shown instead of the first element of a <select> tag, not only if using CTRL-PF5.

Updated

8 months ago
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
I cannot reproduce this with Firefox Nightly 55 on Mac.

Could you please try with the latest Firefox version, and see if the issue exists for you?
Flags: needinfo?(flovro)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
> I cannot reproduce this with Firefox Nightly 55 on Mac.
> 
> Could you please try with the latest Firefox version, and see if the issue
> exists for you?

I tried again on Win10, still cannot reproduce this. Everything works as expected.

CTR+F5 - refreshed page reflects the "selected" attribute correctly.
pressing enter on the address bar - same as above, refreshed page reflects the "selected" attribute correctly.
F5 - page refreshed without seeing the "selected" attribute, but it's expected. As F5 just refreshes the page but it uses cached files.
Haven't heard from reporter for a while. Per comment 2, going to close this as WORKSFORME; feel free to reopen it if the issue is still valid on latest versions. Thanks!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 months ago
Flags: needinfo?(flovro)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.