focus listener on non-form elements in Safari/Chrome

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gregor Kofler

    focus listener on non-form elements in Safari/Chrome

    Setting the tabIndex property an element makes it focusable and attached
    key listeners respond. Or so it seems...

    This procedure works in - from what I've tested - IE6+, FF, Opera.
    However, Safari and Chrome (and perhaps others) fail to respond,
    obviously myElement.focus () can be called, but shows no further effect.

    One possibility might be a listener attached to the document, which then
    redirects the event to the "focused" element - not really elegant.

    Did I overlook something, or does the tabIndex/focus trick simply not
    work in Safari/Chrome?

    Gregor
  • Thomas 'PointedEars' Lahn

    #2
    Re: focus listener on non-form elements in Safari/Chrome

    Gregor Kofler wrote:
    Setting the tabIndex property an element makes it focusable and attached
    key listeners respond. Or so it seems...
    >
    This procedure works in - from what I've tested - IE6+, FF, Opera.
    However, Safari and Chrome (and perhaps others) fail to respond,
    obviously myElement.focus () can be called, but shows no further effect.
    What is `myElement'? Not every element object has a focus() method to begin
    with.
    One possibility might be a listener attached to the document, which then
    redirects the event to the "focused" element - not really elegant.
    ACK.
    Did I overlook something, or does the tabIndex/focus trick simply not
    work in Safari/Chrome?
    Dunno. Post your test case. (I guess you saw that coming ;-))


    PointedEars
    --
    var bugRiddenCrashP ronePieceOfJunk = (
    navigator.userA gent.indexOf('M SIE 5') != -1
    && navigator.userA gent.indexOf('M ac') != -1
    ) // Plone, register_functi on.js:16

    Comment

    Working...