Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Tab focus vs click focus

    Hello,

    We are experimenting with our css styles to give a nice focus effect on several widgets/components while tabbing trough our form fields, tab sets, grids...

    This is working out great but we are wondering if it is possible to apply focus styling only when the focus is triggered by keyboard (and probably also an explicit focus call from within our code) and not when the user clicks in the field.

    The idea here is that the focus should draw the attention of the user while tabbing to the field which is tabbed. When a user manually clicks a certain field focus styling is not that desirable - as it may distract him and since he clicked in the field he certainly knows which field is focused.

    Is there some built in property or pattern that we can use to obtain this kind of behavior?

    #2
    We would strongly recommend against making a distinction between focus styling for keyboard entry vs clicking. It's likely that would be considered as violating accessibility standards.

    If you're dead set on doing this, you might use GWT's EventPreview support to intercept all events, so you know at any given time whether the last event was a keyboard or mouse event.

    Comment

    Working...
    X