Graham Chiu
Graham Chiu

Reputation: 4886

How do you set initial focus in a layout?

rebol []

view [ 
    f: field "" 
    button "focus" on-action [
        focus f
    ]
    when [load] on-action [focus f] 
]

Using the focus button sets the focus correctly but I'd like the focus to set when the panel appears. I'd have thought the load trigger should do this but it doesn't.

Upvotes: 1

Views: 84

Answers (1)

Graham Chiu
Graham Chiu

Reputation: 4886

The correct trigger to use is the 'enter trigger

when [enter] on-action [focus f] 

Upvotes: 0

Related Questions