Select with selectedIndex = -1 still shows the first option

Fixed Issue #10332080


Dzmitry S.
Dec 28, 2016
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

Current behavior
As u can see on the screenshot select has selectedIndex equals to -1 value is empty, but it shows the first option.
I can workaround it by explicitly calling document.getElementById('test').selectedIndex = -1;, but I can’t write a test for it because select has all correct properties (selectedIndex = -1, value = '').

Expected behavior
I think it should never be the case. If select has selectedIndex equals to -1 then it should show a blank line, otherwise it should have selectedIndex equals to 0.

Minimal reproduction of the problem with instructions
The repro includes angular 2 code, but it’s irrelevant to the issue. At first I thought it’s a bug in angular, but it works as expected in Chrome/Firefox.

IE 9-11/Edge


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Brad E.”

      Changed Status to “Not reproducible”

    • Hello,

      Thank you for providing this information about the issue. We are unable to reproduce this behavior in Edge 14393 public stable and it exhibits the same behavior as other browsers. Please reopen this case if you can provide us with new information to consider.

      Best Wishes,
      The MS Edge Team

    • the issue is still reproducible. here’s an example

      you wan’t able to reproduce because I worked around it in the latest version

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Status from “Not reproducible”

      Changed Assigned To to “Travis L.”

      Changed Assigned To from “Travis L.” to “Aparna P.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “Fixed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in