The focus property (string) specifies the id of the form field that should be focused when a modal dialog displayed using DayPilot.Modal.form() opens.
DayPilot.Modal.focusnullThe specified field is focused only when autoFocus is set to true.
const form = [
{name: "Start", id: "start", type: "date"},
{name: "End", id: "end", type: "date"},
{name: "Text", id: "text"},
];
const data = {
text: "Event 1",
start: "2025-11-01",
end: "2025-11-02",
};
const options = {
focus: "text"
};
const modal = await DayPilot.Modal.form(form, data, options);