Skip to content

keyboardUndo

Undo and redo from the keyboard inside an editable calendar.

Typeboolean
Defaulttrue
Live update (update())Yes
Declared inpackages/dom/src/settings.ts

In an editable calendar, Ctrl/Cmd+Z undoes the last change and Ctrl/Cmd+Shift+Z (or Ctrl+Y) redoes it, said for a screen reader — when the focus is in the calendar, not in your fields, and not while an event is held. False leaves those keys to your application (its own undo across the page). calendar.undo() and calendar.redo() work either way.

import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', editable: true, keyboardUndo: false });
// The application's own undo, for the whole page.
document.addEventListener('keydown', (e) => {
if ((e.ctrlKey || e.metaKey) && e.key === 'z') calendar.undo();
});

In Angular and Vue it goes in options; in React it is a prop.