New issue
Advanced search Search tips

Issue 628138 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 247007
Owner: ----
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Firing change event Select fires change event when changing the values with the keyboard

Reported by andrejl...@googlemail.com, Jul 14 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce the problem:
1. go to: https://jsfiddle.net/eqmb6g51/3/
2. focus Select (Select should be closed, all option should not be visible)
3. switch between options with the keyboard

What is the expected behavior?
according to W3C:

The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. This attribute applies to the following elements: INPUT, SELECT, and TEXTAREA.

What went wrong?
In the closed state, it fire onchange with each option switch 

Did this work before? N/A 

Chrome version: 51.0.2704.103  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0
 
Cc: rbyers@chromium.org foolip@chromium.org
Components: -Blink Blink>Forms>Select
Labels: -OS-Windows -Pri-2 Hotlist-Interop OS-All Pri-3
Status: WontFix (was: Unconfirmed)
Summary: Firing change event Select fires change event when changing the values with the keyboard (was: Select fires change event when changing the values with the keyboard)
Select controls aren't the same across platforms or browsers. On Mac at least, Safari does the same thing as Chrome (keyboard navigation results in the value being committed), and Firefox does something slightly different -- keyboard navigation does not commit the value. Instead, "Enter" does. This is clearly not interoperable, but I am not sure which way is better. 

The HTML spec says this: "The change event fires when the value is committed, if that makes sense for the control, or else when the control loses focus." (https://html.spec.whatwg.org/multipage/forms.html#common-input-element-events). This is pretty vague, leaving a lot of wiggle room for browser vendors -- not an ideal situation for the web developers.

andrejlnnk@, the text you're quoting comes from a rather old doc (https://www.w3.org/TR/html4/interact/scripts.html). Please use the HTML spec for your reference.

Even though there's clearly a problem with predictable behavior across browsers/platforms, this is not a bug in Chrome per se. This needs to be addressed at the spec level.

Comment 2 by tkent@chromium.org, Jul 15 2016

Mergedinto: 247007
Status: Duplicate (was: WontFix)
WebKit and Blink are compatible with IE.

Sign in to add a comment