esc clears the calendar

This commit is contained in:
Ben Floyd 2025-06-25 19:40:23 -06:00
parent 9f04947518
commit 41fc8a2083

View file

@ -200,6 +200,15 @@ export class CalendarComponent extends Component {
this.toggleExpanded(collapsedView, expandedView);
}
});
// Add keyboard event listener for Escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && this.expanded) {
e.preventDefault();
e.stopPropagation();
this.toggleExpanded(collapsedView, expandedView);
}
});
}
private updateTodayButton() {