focus custom attribute
Bind an element's focus state with Aurelia's built-in focus custom attribute.
Basic usage (two-way)
<input focus.bind="isFocused">
<button click.trigger="isFocused = true">Focus the input</button>
<button click.trigger="isFocused = false">Blur the input</button>export class MyPage {
public isFocused = false;
}One-way focus (recommended for “open a thing, focus an input”)
<input focus.to-view="shouldFocusSearch">Common pattern: focus when showing a panel
Notes
Last updated
Was this helpful?