mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
feat(planner): ask before a stray click throws away an edited place or booking (#2253)
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user