PadCodedocs

Focus Field

Puts the cursor in a text field, or hides the keyboard with null.

Category: Navigation

#When to use it

Use it to put the cursor where typing should start, or to hide the keyboard when someone is done.

#Example

A new-note screen's When Shown: Focus Field with Id: Title field, so the keyboard opens there. At the end of the Save button's steps, Focus Field with Id left empty hides the keyboard.

#Good to know

  • It works on a Text Field, a Password Field and a Text Area.
  • Id is the field's name: tap its name at the top of the Inspector to give it one. If no view has that name, the step fails.

#Add it

Select a view, open the Inspector's Actions tab, pick when it runs, tap Add action and choose Focus Field (under Navigation). Tap the step to open its settings.

#Settings

SettingWhat it doesKindDefault
IdThe id of a text field, or null to hide the keyboard.Any valueRequired

#See also