Closed Bug 554732 Opened 15 years ago Closed 15 years ago

<select> - selectedIndex incorrectly returns hovered option, not selected option

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 393494

People

(Reporter: seymor42, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 (.NET CLR 3.5.30729) I have a page where I continually check a <select> input for which option is selected. Someone may have option A selected (it shows up in the main <select> window), but hovering over a different option (i.e. option C) in the dropdown view below the select box. When checked at that point, the selectedIndex returns the index of the item being hovered (option C) and not the actual selection (option A). Chrome and Internet Explorer correctly report option A as the selected option in this case. /* javascript check */ document.getElementById('log_name').options[document.getElementById('log_name').selectedIndex].value Reproducible: Always Steps to Reproduce: 1. Create <select> input 2. Have javascript periodically check the selectedIndex 3. Select an option, but hover over a different option when the selectedIndex check occurs. Actual Results: Highlighted option is reported as selectedIndex. Expected Results: Reported the selectedIndex as the one the user had confirmed previously (what shows in the actual select box) and not the one the user is currently hovering over.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.