An open API service indexing awesome lists of open source software.

https://github.com/ismaestro/ngx-scroll-to-first-invalid

Directive to scroll to first invalid form control inside an Angular form on submit
https://github.com/ismaestro/ngx-scroll-to-first-invalid

angular control directive first form invalid scroll submit

Last synced: 2 months ago
JSON representation

Directive to scroll to first invalid form control inside an Angular form on submit

Awesome Lists containing this project

README

        


ngx-scroll-to-first-invalid



Angular directive to scroll to first invalid input inside a form.




LIVE DEMO



Demo example



Report bug
·
Request feature


## Table of contents

- [Usage](#usage)
- [Bugs and feature requests](#bugs-and-feature-requests)
- [Creators](#creators)
- [Copyright and license](#copyright-and-license)

## Usage

```sh
npm i @ismaestro/ngx-scroll-to-first-invalid --save-dev
```

#### 1. Import the directive in your component:

```ts
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [NgxScrollToFirstInvalidDirective, ...],
changeDetection: ChangeDetectionStrategy.OnPush,
})
```

#### 2. Use the directive inside a form:

```html


```

Here you have an example of a form using ngx-scroll-to-first-invalid.
[DEMO](https://ngx-scroll-to-first-invalid.netlify.app)

It also works with nested forms, and recently added support for Angular Ionic.

## Bugs and feature requests

Have a bug or a feature request? Please first read the
[issue guidelines](https://github.com/Ismaestro/ngx-scroll-to-first-invalid/blob/master/CONTRIBUTING.md)
and search for existing and closed issues. If your problem or idea is not addressed yet,
[please open a new issue](https://github.com/Ismaestro/ngx-scroll-to-first-invalid/issues/new).

## Creators

**Ismael Ramos**

-

## Copyright and license

Code released under the
[MIT License](https://github.com/Ismaestro/ngx-scroll-to-first-invalid/blob/master/LICENSE).

Enjoy :metal: