Can I set the focus on an Anvil component?

Can I set the focus on any component? I can’t seem to set it on my button – the ‘focus()’ method does not show up in the list of available options.

My goal is to be able to basically take this ‘vocabulary quiz’ without really taking my hands off the keyboard.

i can Tab and then the button gets highlighted/focused, and then i can hit Enter or and i’m all good, but ideally i’d like to not have to hit that initial Tab key.

i’m open to hacks – maybe I can send a Tab keystroke? I also saw the keyboard capture/trapper posted by another user. don’t know if it works, and i’m not on a paid account yet, but open to checking that out.

3 Likes