Skip to main content

Bug Tracker

Side navigation

#14495 closed bug (notabug)

Opened October 30, 2013 09:27AM UTC

Closed October 30, 2013 02:10PM UTC

Select .val() select a ghost option

Reported by: damien.attanasio@gmail.com Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

With this html :

<select id="select">

<option value="1">Option 1</option>

<option value="2">Option 2</option>

<option value="3">Option 3</option>

</select>

And this command :

$('#select').val(0);

It's okay with jQuery 1.9 but wrong with 1.10.* !

jQuery 1.10 select a ghost empty option ?!

Attachments (0)
Change History (1)

Changed October 30, 2013 02:10PM UTC by gibson042 comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → notabug
status: newclosed

The new behavior is correct; that "ghost empty option" is purely a display artifact of setting selectedIndex to -1. See #13514, 48d71d0c, and PR 1191 for details.