# final-form-set-field-touched

> Mutator for setting a field as "touched" in 🏁 Final Form

Latest version **1.0.1** (published 2019-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install final-form-set-field-touched
pnpm add final-form-set-field-touched
yarn add final-form-set-field-touched
bun add final-form-set-field-touched
```

## Health

**Score 38/100 (D)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-02-07 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/final-form-set-field-touched) |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Erik Rasmussen |
| Maintainers | erikras |

## Links

- npm: https://www.npmjs.com/package/final-form-set-field-touched
- Repository: https://github.com/final-form/final-form-set-field-touched
- Homepage: https://github.com/final-form/final-form-set-field-touched#readme
- Issues: https://github.com/final-form/final-form-set-field-touched/issues
- npm.io page: https://npm.io/package/final-form-set-field-touched

## Recent versions

- 1.0.1 (latest) — 2019-02-07
- 1.0.0 — 2018-01-11

## README

# 🏁 Final Form Set Field Touched

[![NPM Version](https://img.shields.io/npm/v/final-form-set-field-touched.svg?style=flat)](https://www.npmjs.com/package/final-form-set-field-touched)
[![NPM Downloads](https://img.shields.io/npm/dm/final-form-set-field-touched.svg?style=flat)](https://www.npmjs.com/package/final-form-set-field-touched)
[![Build Status](https://travis-ci.org/final-form/final-form-set-field-touched.svg?branch=master)](https://travis-ci.org/final-form/final-form-set-field-touched)
[![codecov.io](https://codecov.io/gh/final-form/final-form-set-field-touched/branch/master/graph/badge.svg)](https://codecov.io/gh/final-form/final-form-set-field-touched)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

Mutator for setting a field as "touched" in [🏁 Final Form](https://github.com/final-form/final-form).

---

## Installation

```bash
npm install --save final-form-set-field-touched
```

or

```bash
yarn add final-form-set-field-touched
```

## Usage

```js
import { createForm } from 'final-form'
import setFieldTouched from 'final-form-set-field-touched'

// Create Form
const form = createForm({
  mutators: { setFieldTouched },
  onSubmit
})

form.mutators.setFieldTouched('firstName', true)

form.registerField(
  'firstName',
  fieldState => {
    const { touched } = fieldState // true
  },
  {
    // ...other subscription items
    touched: true
  }
)
```

## Mutator

### `form.mutators.setFieldTouched(name: string, touched: boolean) => void`

Sets the specified field's `touched` flag to the boolean value provided.

---
_Source: https://npm.io/package/final-form-set-field-touched · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
