Skip to content

Commit

Permalink
Updating README with stackblitz example.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarrew committed Dec 23, 2021
1 parent a573368 commit 8dd2d67
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 68 deletions.
35 changes: 2 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,39 +92,8 @@ This directive also provides built-in validation for minimum and maximum values.
<input currencyMask [(ngModel)]="value" min="-10.50" max="100.75" />
```

## Quick fixes
### Example App

### Ionic 2-3

Input not working on mobile keyboard

```html
<!-- Change the type to 'tel' -->
<input currencyMask type="tel" [(ngModel)]="value" />
```

Input focus get hide by the mobile keyboard

on HTML

```html
<!-- Change the type to 'tel' -->
<input currencyMask type="tel" [(ngModel)]="value" [id]="'yourInputId' + index" (focus)="scrollTo(index)" />
```

on .ts

```ts
import { Content } from 'ionic-angular';

export class...

@ViewChild(Content) content: Content;

scrollTo(index) {
let yOffset = document.getElementById('yourInputId' + index).offsetTop;
this.content.scrollTo(0, yOffset + 20);
}
```
https://angular-ivy-bpn8by.stackblitz.io

## Questions? Open a Issue!
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-currency-mask",
"version": "13.0.0",
"version": "13.0.1",
"description": "A very simple currency mask directive that allows using a number attribute with the ngModel.",
"repository": {
"type": "git",
Expand Down
35 changes: 2 additions & 33 deletions projects/ng2-currency-mask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,39 +92,8 @@ This directive also provides built-in validation for minimum and maximum values.
<input currencyMask [(ngModel)]="value" min="-10.50" max="100.75" />
```

## Quick fixes
### Example App

### Ionic 2-3

Input not working on mobile keyboard

```html
<!-- Change the type to 'tel' -->
<input currencyMask type="tel" [(ngModel)]="value" />
```

Input focus get hide by the mobile keyboard

on HTML

```html
<!-- Change the type to 'tel' -->
<input currencyMask type="tel" [(ngModel)]="value" [id]="'yourInputId' + index" (focus)="scrollTo(index)" />
```

on .ts

```ts
import { Content } from 'ionic-angular';

export class...

@ViewChild(Content) content: Content;

scrollTo(index) {
let yOffset = document.getElementById('yourInputId' + index).offsetTop;
this.content.scrollTo(0, yOffset + 20);
}
```
https://angular-ivy-bpn8by.stackblitz.io

## Questions? Open a Issue!
2 changes: 1 addition & 1 deletion projects/ng2-currency-mask/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-currency-mask",
"version": "13.0.0",
"version": "13.0.1",
"peerDependencies": {
"@angular/common": ">= 12.x.x",
"@angular/core": ">= 12.x.x"
Expand Down

0 comments on commit 8dd2d67

Please sign in to comment.