← Back to examples

Focus Input Demo

Test the three ways to control chat input focus: autoFocusInput config, controller.focusInput(), and persona:focusInput DOM event.

1. autoFocusInput (init parameter)

When enabled, the input focuses after the panel opens and the open animation completes (~200ms).

Toggle on, then open the launcher (click the floating button) — the input should auto-focus. For inline, reload the page with the checkbox on.

2. controller.focusInput()

Programmatically focus the input. Returns false if the launcher panel is closed.

3. persona:focusInput (DOM event)

Dispatch a window event to focus a specific instance or all instances.

Log

Inline widget (always visible). Launcher floats bottom-right.