Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Issue 244406 SELECT box with MULTIPLE option fires ONCHANGE event on scroll
Starred by 27 users Reported by simon.au...@gmail.com, May 28 2013 Back to list
Status: Verified
Owner:
Closed: Jun 2013
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug-Regression



Sign in to add a comment
Chrome Version       : 27.0.1453.94 (Official Build 201630) m
URLs (if applicable) : N/A
Other browsers tested: Firefox 20/21: OK
                       IE 9: OK
                       Chrome 26: OK

What steps will reproduce the problem?
1. Create a SELECT dropdown with the option MULTIPLE and an ONCHANGE call, eg 

<html><head><title>Test Chrome Multiple Select Bug</title>
<script>
function submit() {
return true;
}
</script>
</head>
<body>
<form>
<select name="test" id="test" multiple size="3" onchange="submit()">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
<option value="7">Option 7</option>
</select>
</form>
</body>
</html>

2. Load the page and try and scroll down to select any option beyond 4.

What is the expected result?

The dropdown should scroll down to display the further options.

What happens instead?

The dropdown is immediately submitted, and the top 4 elements are show again.

Please provide any additional information below. Attach a screenshot if
possible.
 
Labels: Cr-Blink-Forms
Unable to repro.
Comment 2 Deleted
Comment 3 by bmoc...@gmail.com, May 28 2013
I have the same issue. Version 27.0.1453.94 m
It is not an issue in 26.
Comment 4 by tkent@chromium.org, May 28 2013
Labels: -Type-Bug -Pri-2 Type-Bug-Regression Pri-1 M-28 ReleaseBlock-Stable Needs-Bisect
Status: Available
Confirmed with 27.0.1453.93 Mac.

Comment 5 by tkent@chromium.org, May 29 2013
Cc: mkwst@chromium.org
Labels: -Needs-Bisect
You are probably looking for a change made after 183857 (known good), but no later than 183892 (first known bad).
CHANGELOG URL:
  http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk/src&range=183857%3A183892
  http://trac.webkit.org/log/?rev=143626&stop_rev=143560&verbose=on


I guess http://trac.webkit.org/changeset/143560 unveiled an existing bug of HTMLSelectElement.

Comment 6 by kic...@gmail.com, May 29 2013
Noticed the same issue today, also v 27.0.1453.94 m (Win 7 x64).

Additional notes: It only seems to fire onchange if no selection has been made.  Once a selection has been made (even if later unselected) the onchange no longer fires when scrolling.

Clearing a select box using javascript and re-populating it will trigger the onchange problem again.  I'm clearing the select using ele.options.length=0;

Comment 7 by tkent@chromium.org, May 29 2013
Owner: tkent@chromium.org
Status: Started
I'm seeing this on Linux in Chrome 27.0.1453.93, and it was reported to me by a windows user.
The only workaround I've thought of is to have the onchange event call a javascript function that checks whether the selection has actually changed, and only does the
submit() if it's really needed. Any other ideas?
Of course, fixing chrome would be the best solution!

Project Member Comment 9 by bugdroid1@chromium.org, May 30 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=151430

------------------------------------------------------------------------
r151430 | tkent@chromium.org | 2013-05-30T00:44:18.485022Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/select/listbox-click-on-scrollbar.html?r1=151430&r2=151429&pathrev=151430
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLSelectElement.cpp?r1=151430&r2=151429&pathrev=151430
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/select/listbox-click-on-scrollbar-expected.txt?r1=151430&r2=151429&pathrev=151430

REGRESSION: Select listbox dispatches a change event on scroll.

wkrev.com/143560 fixed mouse events on scrollbars, and broke an
HTMLSelectElement assumption that mouseup event always happens on an
<option> element. So, listBoxOnChange() was called unexpectedly.

This patch avoids this problem by checking
m_lastOnChangeSelection.isEmpty(), which means we didn't start click
or drag in this <select> element.

BUG= 244406 
TEST=automated
R=keishi@chromium.org

Review URL: https://codereview.chromium.org/16184002
------------------------------------------------------------------------
Comment 10 by Deleted ...@, May 31 2013
Noticed this in Chrome 27.0.1453.94 m (Win 8 x64). Serious bug, broke user interaction with our application. :(
Labels: Merge-Requested
Status: Verified
Verified the fix with 29.0.1525.0 canary.

Now the onchange event doesn't trigger anymore, but the scrolling seems off. The scrolling speed when dragging the scrollbar is so fast that it is almost only possible to have it at the top or bottom. If you increase the height a little of the listbox the scrollbar seems to warp in size as you drag it closer to the bottom. Also the listbox adds a large empty area after the last item.
To reproduce the warping scroll size behaviour use original code but set size to 5 or 6 instead.

FYI: Scroll issue is  Issue 244734 .

Labels: -Merge-Requested Merge-Approved
Project Member Comment 15 by bugdroid1@chromium.org, Jun 3 2013
Labels: -Merge-Approved merge-merged-chromium
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=151689

------------------------------------------------------------------------
r151689 | tkent@chromium.org | 2013-06-03T21:37:32.782292Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/branches/chromium/1500/Source/core/html/HTMLSelectElement.cpp?r1=151689&r2=151688&pathrev=151689
   A http://src.chromium.org/viewvc/blink/branches/chromium/1500/LayoutTests/fast/forms/select/listbox-click-on-scrollbar-expected.txt?r1=151689&r2=151688&pathrev=151689
   A http://src.chromium.org/viewvc/blink/branches/chromium/1500/LayoutTests/fast/forms/select/listbox-click-on-scrollbar.html?r1=151689&r2=151688&pathrev=151689

Merge 151430 "REGRESSION: Select listbox dispatches a change eve..."

> REGRESSION: Select listbox dispatches a change event on scroll.
> 
> wkrev.com/143560 fixed mouse events on scrollbars, and broke an
> HTMLSelectElement assumption that mouseup event always happens on an
> <option> element. So, listBoxOnChange() was called unexpectedly.
> 
> This patch avoids this problem by checking
> m_lastOnChangeSelection.isEmpty(), which means we didn't start click
> or drag in this <select> element.
> 
> BUG= 244406 
> TEST=automated
> R=keishi@chromium.org
> 
> Review URL: https://codereview.chromium.org/16184002

TBR=tkent@chromium.org
BUG= 244406 

Review URL: https://codereview.chromium.org/16305020
------------------------------------------------------------------------
Labels: -M-28 -merge-merged-chromium M-27 merge-merged-1500 Merge-Requested
 Issue 246505  has been merged into this issue.
Comment 18 by Deleted ...@, Jun 5 2013
Confirmed with 27.0.1453.94m Win7.
Comment 19 by Deleted ...@, Jun 5 2013
I updated to chrome 27.0.1453.110m and still this issue.
Comment 20 by Deleted ...@, Jun 6 2013
I am also still seeing the issue in Version 27.0.1453.110 m.
Any news when it will be fix?
This is happening even on Windows Vista Business and Chrome Version 27.0.1453.110 m

Comment 23 by kareng@google.com, Jun 7 2013
Labels: -Merge-Requested Merge-Approved
Project Member Comment 24 by bugdroid1@chromium.org, Jun 8 2013
Labels: -Merge-Approved merge-merged-chromium
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=152069

------------------------------------------------------------------------
r152069 | tkent@chromium.org | 2013-06-08T05:33:19.827315Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/branches/chromium/1453/Source/WebCore/html/HTMLSelectElement.cpp?r1=152069&r2=152068&pathrev=152069

Merge 151430 "REGRESSION: Select listbox dispatches a change event on scroll."

> REGRESSION: Select listbox dispatches a change event on scroll.
>
> wkrev.com/143560 fixed mouse events on scrollbars, and broke an
> HTMLSelectElement assumption that mouseup event always happens on an
> <option> element. So, listBoxOnChange() was called unexpectedly.
>
> This patch avoids this problem by checking
> m_lastOnChangeSelection.isEmpty(), which means we didn't start click
> or drag in this <select> element.
>
> BUG= 244406 
> TEST=automated

BUG= 244406 
TBR=tkent@chromium.org

------------------------------------------------------------------------
Labels: -merge-merged-chromium merge-merged-1453
Labels: TE-Verified-27.0.1453.116
Tested this issue with Latest Stable#27.0.1453.116 on Win7, Mac 10.8.3, Ubuntu 12.04 & CrOS (3912.101.0 stable-channel link) - Working as intended (Able to scroll down to the options beyond '4' in the sample HTML page).

PS: Attached the screenshot for your reference.

Thank you.
 
244406.JPG
12.5 KB View Download
Problem is still present for me, i'm using ASP.net the dropdown don't keep is position. It working in all other browser, all previous version of chrome and canary edition
This bug seems only partially resolved. The new version does fix the OP's example, but if you are using javascript to repopulate the pulldown with new options, the original problem remains.

In the attached example scroll down to Option 6 or 7 (this works fine now). This will activate some javascript to populate new options. Once the new options are displayed, you will notice that scrolling activates the onChange as it did before.

<html><head><title>Test Chrome Multiple Select Bug - V2</title>
<script>
function doThis(){

document.forms[0].test.options.length = 0;
document.forms[0].test.options[0] = new Option('New Option 1','1');
document.forms[0].test.options[1] = new Option('New Option 2','2');
document.forms[0].test.options[2] = new Option('New Option 3','3');
document.forms[0].test.options[3] = new Option('New Option 4','4');
document.forms[0].test.options[4] = new Option('New Option 5','5');
document.forms[0].test.options[5] = new Option('New Option 6','6');
document.forms[0].test.options[1].selected = true;    

}
</script>
</head>
<body>
    
    
<form>
<select name="test" id="test" size="3" onchange="doThis();">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
<option value="7">Option 7</option>
</select>
</form>
</body>
</html>

test.htm
991 bytes View Download
Comment 29 by tkent@chromium.org, Jun 20 2013
nostradavemus, would you file new bug please?

Comment 30 by tkent@chromium.org, Jun 21 2013
Filed  Issue 252559  for the issue of Comment 28.

Sign in to add a comment