Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProAn action sheet that asks Discard changes or Keep editing when someone leaves a form with unsaved edits, and lets them leave straight away when nothing changed. Use this when a phone form has unsaved edits and the Back or Close button would lose them.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use it when a phone form has unsaved edits and the Back or Close button would lose them.
Do not use it for forms that autosave, or for tiny forms where losing the input costs nothing.
This item is part of tealmac UI Pro
The source for this item installs with a Pro licence key. Log in with your key to see the install command, or read the Pro setup page.
| Prop | Type | Default | Description |
|---|---|---|---|
initial | string | required | The saved value. |
onLeave | () => void | required | Called when the person leaves (after discarding or with no changes). |
onSave | (value: string) => void | required | Called by Save. |
The pattern ships with a Testing Library test (confirm-leave-sheet.test.tsx) that drives it through roles and the keyboard.