Skip to content

Commit

Permalink
Fix using Android in some circumstances.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarrew committed Dec 23, 2021
1 parent d0047a1 commit 7325c87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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.2",
"version": "13.0.3",
"description": "A very simple currency mask directive that allows using a number attribute with the ngModel.",
"repository": {
"type": "git",
Expand Down
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.2",
"version": "13.0.3",
"peerDependencies": {
"@angular/common": ">= 12.x.x",
"@angular/core": ">= 12.x.x"
Expand Down
3 changes: 2 additions & 1 deletion projects/ng2-currency-mask/src/lib/input.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ export class InputHandler {
private setCursorPosition(event: any): void {
let rawValueWithoutSuffixEndPosition = this.inputService.getRawValueWithoutSuffixEndPosition();

// For some reason in android the event got override before the timeout and change the target, so I needed to store the input target in a variable
// For some reason, in Android, the event got override before the timeout and change the target.
const inputElement = event.target;

setTimeout(function () {
inputElement.setSelectionRange(rawValueWithoutSuffixEndPosition, rawValueWithoutSuffixEndPosition);
}, 0);
Expand Down

0 comments on commit 7325c87

Please sign in to comment.