# confirmPhrase

> Why JS: a button cannot disable itself until a field matches a phrase, so script keeps a type-to-confirm dialog's confirming control disabled until the text matches exactly.

```ts
import { confirmPhrase } from "@sdxc/ui/mixins";
```

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

```ts
confirmPhrase(phrase: string): MixinDescriptor<HTMLInputElement>
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `phrase` | `string` |  |

## Examples

```tsx
<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.

### CONFIRM_ACTION_ATTRIBUTE

Attribute marking a dialog's confirming control, which confirmPhrase enables on a match.

#### Signature

```ts
const CONFIRM_ACTION_ATTRIBUTE = "data-confirm-action"
```
