diff --git a/components/calendar/__tests__/task-modal-calendars.test.tsx b/components/calendar/__tests__/task-modal-calendars.test.tsx
index 1bd0abf30..15eb01375 100644
--- a/components/calendar/__tests__/task-modal-calendars.test.tsx
+++ b/components/calendar/__tests__/task-modal-calendars.test.tsx
@@ -34,3 +34,16 @@ describe('task editor calendar select', () => {
expect(select.value).toBe('birthdays');
});
});
+
+// The desktop task panel had no dialog role, unlike the event editor.
+describe('task editor panel', () => {
+ it('is a dialog named by its title on wide screens', () => {
+ render();
+ expect(screen.getByRole('dialog', { name: 'tasks.create' })).toBeInTheDocument();
+ });
+
+ it('leaves the role to the full-screen wrapper on a phone', () => {
+ render();
+ expect(screen.queryByRole('dialog')).toBeNull();
+ });
+});
diff --git a/components/calendar/task-modal.tsx b/components/calendar/task-modal.tsx
index 26507e54d..fb89b9505 100644
--- a/components/calendar/task-modal.tsx
+++ b/components/calendar/task-modal.tsx
@@ -56,7 +56,7 @@ export function TaskModal({
onDelete,
onClose,
onDirtyChange,
- isMobile: _isMobile,
+ isMobile = false,
isSubscriptionCalendar,
}: TaskModalProps) {
const t = useTranslations("calendar");
@@ -213,10 +213,17 @@ export function TaskModal({
}, [requestClose, handleSave]);
return (
-
+ // The desktop side panel is a dialog named by its title, like the event
+ // editor; on a phone the full-screen wrapper around it is.
+
{/* Header */}
-
+
{isEdit ? t("tasks.edit") : t("tasks.create")}