The autoFocus property (boolean) enables or disables automatic focus for forms displayed using DayPilot.Modal.form().
Declaration
DayPilot.Modal.autoFocusDefault Value
trueNotes
By default, the modal dialog focuses the first form field when it opens. You can use the focus property to target a specific field instead.
Example
const form = [
{name: "Start", id: "start", type: "datetime"},
{name: "End", id: "end", type: "datetime"},
{name: "Text", id: "text"},
];
const data = {
text: "Event 1",
start: "2025-11-01T10:00:00",
end: "2025-11-02T12:00:00",
};
const modal = await DayPilot.Modal.form(form, data, {
autoFocus: false
});See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot