Add a Set Focus Block

About this task

Set Focus block

The Set Focus block is part of the toolbox App Actions category. Use a Set Focus block to make another widget active and ready to accept input without the user selecting it. This action reduces user effort and can guide the user to the next required input.

Procedure

  1. In the Blockly Editor, select App Actions and drag and drop the Set Focus block onto the Blockly canvas.
  2. On the Set Focus block, select the list of app widgets, and select the widget you would like to receive focus.
  3. Save your Blockly content and test the event in your app.

Results

When the event is triggered from your widget, the focus changes to your target widget to accept input.