Re: select onchange with typing in Webkit



Chris Riesbeck wrote:
Thomas 'PointedEars' Lahn wrote:
Chris Riesbeck wrote:
dhtml wrote:
Chris Riesbeck wrote:
Toy example at

http://www.cs.northwestern.edu/~riesbeck/demo/menutest.html
Focus the select and type 's'.

Result:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18
(KHTML, like Gecko) Version/3.1.2 Safari/525.22

'shoe' is selected, onchange does not fire

Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/527.3+
(KHTML, like Gecko) Version/3.1.2 Safari/525.22

'shoe' is selected, onchange fires

Same version, but "AppleWebKit/527.3+" it works.

Garrett
Though that behavior, while shared by IE, FF and Opera, isn't required by
the standard, I think.
You are mistaken.

The W3C site
That *is* the standard, not just a "W3C site".

just says that when focus is lost, and the selection has changed, then it
should fire.
And the element did not lose focus, did it?

Typing in the menu does not lose focus. Therefore, no onchange is
required to be fired. However onchange is fired in IE, FF, and Opera.

Indeed, I did not know that since I seldom listen to `change' events on
`select' controls with size > 1.

Hence I said this behavior is not portable.

You are not making much sense here, though. Since all major DOMs do that,
including the WebKit DOM (with the exception of prefix selection, which is a
bug that will probably be fixed in the next release), isn't it instead that
this behavior *is* portable/interoperable?

Are you saying onchange should be fired according to the standard?

Either that, or I overlooked something in the standard (unlikely), or this
behavior should become the standard (since it appears to be interoperable).
However, the problem with the latter would be that the `change' event
definition would become more complicated and bound to a particular markup
language, which I don't think would be a Good Thing.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
.



Relevant Pages

  • Re: select onchange with typing in Webkit
    ... 'shoe' is selected, onchange does not fire ... The W3C site just says that when focus is lost, and the selection has changed, then it should fire. ...
    (comp.lang.javascript)
  • Re: select onchange with typing in Webkit
    ... 'shoe' is selected, onchange does not fire ... should fire. ... Prototype.js was written by people who don't know javascript for people ...
    (comp.lang.javascript)
  • Re: select onchange with typing in Webkit
    ... 'shoe' is selected, onchange does not fire ... The W3C site just says that when focus is lost, and the selection has changed, then it should fire. ... clicking and selecting ...
    (comp.lang.javascript)
  • Re: select onchange with typing in Webkit
    ... (KHTML, like Gecko) ... 'shoe' is selected, onchange does not fire ... should fire. ...
    (comp.lang.javascript)
  • Re: select box - using refresh to select same item twice
    ... and found out that you need to do a refresh in ... so you can click on the same item twice "in a row" to select it. ... It is generally a bad idea to use onchange with a select for anything, ... have a useful default selection, ...
    (comp.lang.javascript)