My favorites | Sign in
Google
          
New issue | Search
for
| Advanced search | Search tips
Issue 1788: Browser: First item is ever selected in HTML select with multiple attribute
3 people starred this issue and may be notified of changes. Back to list
Status:  FutureRelease
Owner:  c...@android.com
Closed:  Aug 14
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by jmarr...@innowhere.com, Jan 14, 2009

On Android browser the first item is ever selected in HTML select with
multiple attribute.

Create an HTML page with this code:

<select multiple="multiple">
<option>One</option>
<option>Two</option>
<option>Three</option>
</select>

When clicking to see what elements are selected the first element is showed
as selected.

This bug was present and fixed in iPhone too so it could be already fixed
in WebKit.


Comment 1 by jbq@google.com, Jan 21, 2009
This issue is assigned to an engineer for further evaluation
Comment 2 by jbq@google.com, Jan 21, 2009
(No comment was entered for this change.)
Status: Reviewed
Comment 3 by jmarr...@innowhere.com, Jan 21, 2009
This bug is related with the following bug:

When you insert a new <option> element using JavaScript as the first element, all is
correct while the script is running, the "selected" property is false as it must be.
When the script ends the component is visually updated, in this moment the "selected"
property is automatically changed to true.

You can change the "selected" property to false again using JavaScript and it works,
there is no automatic change to true in this case (the component is not visually
updated but the state is correct).

Comment 4 by jmarr...@innowhere.com, Jan 21, 2009
New finding: When the first <option> element is removed, the next <option> becomes
the new first option, in this case the "selected" property of this element is
erroneously changed to true.


Comment 5 by jmarr...@innowhere.com, Jan 21, 2009
Correction: any option added or removed with JavaScript causes this bug, I think the
problem arises when WebKit re-render the component after insertion/removing when the
script ends.

Comment 6 by Scroggo, May 28, 2009
The problem is we have a change to WebKit which turns a <select multiple="multiple"> 
into a menulist.  I am trying to figure out how the iPhone does it without seeing 
this bug, the proper way, so we can merge with WebKit more cleanly. 
Comment 7 by jmarr...@innowhere.com, May 29, 2009
Be careful with your investigations in the WebKit code related to iPhone, this
problem was present and fixed in iPhone (in fact I think your initial code was got
from the iPhone version of WebKit). In spite of this, the behavior of select multiple
(DOM point of view) is a nightmare in iPhone, values of "selected" properties are
wrong until you leave the "menu list" for selection, so be very careful when you
inspect the WebKit repository. Furthermore, multiple selection using some kind of
menu list is problematic in any WebKit based browser.

In ItsNat I fix this problem with a timer resetting a false the conflictive option
because the selected property is set to true when the select control is visually
updated. I think this may help you.


Comment 8 by Scroggo, Jun 23, 2009
This was fixed internally
Comment 9 by c...@android.com, Aug 14, 2009
(No comment was entered for this change.)
Status: FutureRelease
Owner: c...@android.com
Sign in to add a comment