focus
focus: boolean
Controls whether the chat widget automatically focuses when initialized. By default, this property is set to true
.
Usage Example
const chat = new ChatBot(node, { focus: false });
This example initializes the chat widget with auto-focus disabled.
Setting Auto-Focus
chat.setConfig({ focus: false });
Changes the auto-focus property to false
after the widget has been initialized. By default, the auto-focus property is set to true
.
Getting Current Auto-Focus State
const chat = new ChatBot(node, { focus: false });
const focusState = chat.getConfig().focus;
Retrieves the current state of the auto-focus property. In this example, focusState
would be false
. By default, the auto-focus property is set to true
.