# constraint-validation-buggyfill

> Prevents invalid form submission in browsers that improperly support the HTML forms spec (i.e. Safari). The first invalid element is focused after alerting the validation message.

Latest version **2.0.0** (published 2019-12-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install constraint-validation-buggyfill
pnpm add constraint-validation-buggyfill
yarn add constraint-validation-buggyfill
bun add constraint-validation-buggyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-12-31 |
| First published | 2016-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jayden Seric |
| Maintainers | jaydenseric |
| Keywords | HTML5, form, forms, constraint, constraints, validation, buggyfill, polyfill |

## Links

- npm: https://www.npmjs.com/package/constraint-validation-buggyfill
- Repository: https://github.com/jaydenseric/constraint-validation-buggyfill
- Homepage: https://github.com/jaydenseric/constraint-validation-buggyfill#readme
- Issues: https://github.com/jaydenseric/constraint-validation-buggyfill/issues
- Funding: https://github.com/sponsors/jaydenseric
- npm.io page: https://npm.io/package/constraint-validation-buggyfill

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2019-12-31
- 1.0.0 — 2019-08-02
- 0.1.1 — 2016-08-21

## README

# constraint-validation-buggyfill

[![npm version](https://badgen.net/npm/v/constraint-validation-buggyfill)](https://npm.im/constraint-validation-buggyfill) [![CI status](https://github.com/jaydenseric/constraint-validation-buggyfill/workflows/CI/badge.svg)](https://github.com/jaydenseric/constraint-validation-buggyfill/actions)

Prevents invalid form submission in browsers that improperly support the HTML forms spec (e.g. Safari v5 → 10). The first invalid element is focused after alerting the validation message. An alert is used due to poor browser support for [`reportValidity()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/reportValidity).

## Setup

### npm setup

To install from [npm](https://npmjs.com) run:

```sh
npm install constraint-validation-buggyfill
```

Add this import to components with forms:

```js
import 'constraint-validation-buggyfill'
```

### CDN setup

To install from [npm](https://npmjs.com) via the [UNPKG CDN](https://unpkg.com), add this script to pages with forms:

```html
<script src="https://unpkg.com/constraint-validation-buggyfill"></script>
```

## Support

- Node.js v10+
- Browsers [`> 0.5%, not dead, IE >= 10, ExplorerMobile >= 10, Firefox >= 4, Chrome >= 10, Safari >= 5, iOS >= 4, Android >= 4, BlackBerry >= 7, KaiOS >= 2.5`](https://browserl.ist/?q=%3E+0.5%25%2C+not+dead%2C+IE+%3E%3D+10%2C+ExplorerMobile+%3E%3D+10%2C+Firefox+%3E%3D+4%2C+Chrome+%3E%3D+10%2C+Safari+%3E%3D+5%2C+iOS+%3E%3D+4%2C+Android+%3E%3D+4%2C+BlackBerry+%3E%3D+7%2C+KaiOS+%3E%3D+2.5)

## See

- [Caniuse: Form validation](http://caniuse.com/#feat=form-validation)
- [WebKit Bugzilla: Support for interactive validation of form elements](https://bugs.webkit.org/show_bug.cgi?id=28649)
- [W3C HTML form submission algorithm](https://www.w3.org/TR/html52/sec-forms.html#form-submission-algorithm)
- [WHATWG HTML form submission algorithm](https://html.spec.whatwg.org/multipage/forms.html#form-submission-algorithm)

---
_Source: https://npm.io/package/constraint-validation-buggyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
