feat(planner): ask before a stray click throws away an edited place or booking (#2253)

This commit is contained in:
Maurice
2026-10-01 13:11:09 +02:00
parent 477f41693d
commit a98449d573
32 changed files with 199 additions and 7 deletions
@@ -995,6 +995,8 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
labelledBy={titleId}
width={width}
align="top"
// A stray click beside the editor asks before the typing is lost (#2253).
discardGuard={{ form, files: S.pendingFiles.length }}
onPaste={S.handlePaste}
header={header}
footer={footer}
@@ -439,6 +439,8 @@ export function ReservationModal({ isOpen, onClose, onSave, reservation, days, p
labelledBy={titleId}
width="editor"
align="top"
// A stray click beside the editor asks before the typing is lost (#2253).
discardGuard={{ form, files: pendingFiles.length, travelers: [...travelerIds] }}
onSubmit={handleSubmit}
header={header}
footer={footer}
@@ -1055,6 +1055,8 @@ export function TransportModal({ isOpen, onClose, onSave, reservation, days, sel
width="editor"
align="top"
blocked={showDeleteConfirm}
// A stray click beside the editor asks before the typing is lost (#2253).
discardGuard={{ form, waypoints, trainWaypoints, carStops, files: pendingFiles.length, travelers: [...travelerIds] }}
onSubmit={automated ? undefined : handleSubmit}
header={header}
footer={footer}