saveBarSync
Why JS.
import { saveBarSync } from "@sdxc/ui/app";Usage
Applied to the bar ([data-slot="save-bar"]): unhides it while the form's values differ
from their baseline, which a submission moves to the submitted values, and ⌘S saves them
unless the form's own primary save answers it. [role="status"] announces message.
Signature
saveBarSync(options: SaveBarSync.Options): MixinDescriptor<HTMLElement>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | SaveBarSync.Options | Yes |
Examples
<div hidden mix={[saveBarSync({ message: "Unsaved changes" })]}>…</div>Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/app too.
Interface
SaveBarSync.Options
Configuration for saveBarSync.
| Member | Type | Required | Description |
|---|---|---|---|
form | string | No | The id of the watched form; omit when the bar sits inside it. |
message | string | Yes | What the bar's live region announces once the form changes, such as "Unsaved changes". |