select onchange with typing in Webkit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Riesbeck

    select onchange with typing in Webkit

    In Firefox, IE and Opera, with a select menu with size 1, typing a few
    characters in the menu selects an item and triggers the onchange event.

    In the Webkit-based Safari and Google Chrome, the item appears to be
    selected (visually and selectedIndex is set) but the onchange is not
    triggered.

    The W3C says "The onchange event occurs when a control loses the input
    focus and its value has been modified since gaining focus."



    Doesn't that mean if you type to select then tab or click away from the
    menu, the onchange should fire? This doesn't happen in Safari or Google
    Chrome.

    I can work around this with an onblur but is it me or Webkit not getting
    this right?

    Toy example at


  • Thomas 'PointedEars' Lahn

    #2
    Re: select onchange with typing in Webkit

    Chris Riesbeck wrote:
    The W3C says "The onchange event occurs when a control loses the input
    focus and its value has been modified since gaining focus."
    >

    >
    Doesn't that mean if you type to select then tab or click away from the
    menu, the onchange should fire?
    It does mean that.
    This doesn't happen in Safari or Google Chrome.
    It does happen in "Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE)
    AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21".


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

    Comment

    • Jorge

      #3
      Re: select onchange with typing in Webkit

      On Oct 9, 1:35 am, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
      wrote:
      (...)
      That is indeed a bug as is Safari's not regarding the selection a change in
      the control's value when it is caused by putting in the leading characters;
      however, Quirks Mode might trigger this non-standard behavior.  (I cannot
      test it right now.)
      I did. I does fail in Safari 3.1.2, latest released version.
      But it's been fixed already in the nightly builds (I tested r36882):

      SequoiaSonoma 298176@main August 3, 2025 at 02:33 AM PDT 298175@main August 2, 2025 at 10:19 PM PDT 298174@main August 2, 2025 at 09:21 PM PDT 298173@main August 2, 2025 at 06:23 PM PDT 298172@main August 2, 2025 at 03:39 PM PDT 298171@main August 2, 2025 at 12:53 PM PDT 298170@main August 2, 2025 at 01:03 […]


      --
      Jorge.

      Comment

      Working...