ClearFocus requires APL 1.1 or later. Provide an alternate experience for devices running older versions of APL.
Removes focus from the actionable component that has focus. For details about the components that can receive and lose focus, see Focused.
Because only one component can have focus at a time,
ClearFocus always affects at most one component.
ClearFocus runs, the command removes focus from the component that has it, and sets the
focused state for that component to
ClearFocus command has no properties other than the common command properties. Set the
type property to
For example, to clear focus from any component that has it:
ClearFocus command runs in fast mode, but without any delay.
The following example uses the
onMount handler to set the focus to the first item in the list. The SetFocus button changes the focus to the next item in the list. Click the Clear all focus button to run the
Was this page helpful?
Last updated: frontmatter-missing