confirmPhrase
Why JS.
import { confirmPhrase } from "@sdxc/ui/mixins";Usage
Applied to a type-to-confirm field: enables the enclosing dialog's
[data-confirm-action] control exactly while the field holds phrase, and clears the
field when the dialog closes so every opening starts locked.
Signature
confirmPhrase(phrase: string): MixinDescriptor<HTMLInputElement>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phrase | string | Yes |
Examples
<Input pattern={escaped} required mix={[confirmPhrase("acme-ops")]} />Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/mixins too.
Constant
CONFIRM_ACTION_ATTRIBUTE
Attribute marking a dialog's confirming control, which confirmPhrase enables on a match.
const CONFIRM_ACTION_ATTRIBUTE = "data-confirm-action"