Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor jumps at beginning ifthe model is set #984

Closed
florinsuman opened this issue Mar 21, 2022 · 7 comments
Closed

Cursor jumps at beginning ifthe model is set #984

florinsuman opened this issue Mar 21, 2022 · 7 comments

Comments

@florinsuman
Copy link

florinsuman commented Mar 21, 2022

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description

the cursor jumps at the beginning when -, or 0, or 0,0, or 0,00 or 0,0000000 is typed if the model is set in typescript

🔬 Minimal Reproduction

https://stackblitz.com/edit/ngx-mask-negative-number-cursor-jump-bug-v5j7fs

🔥 Exception or Error

<input
  type="text"
  id="valueId"
  [(ngModel)]="decimalValue"
  name="valueName"
  mask="separator.8"
  thousandSeparator="."
  decimalMarker=","
  [allowNegativeNumbers]="true"
  [specialCharacters]="[',', '.']"
/>
export class AppComponent {
  decimalValue = 0.723;
  constructor() {}
}

🌍 Your Environment

Angular Version:




"ngx-mask": "9.1.2"

"dependencies": {
    "@angular/animations": "11.2.0",
    "@angular/common": "11.2.0",
    "@angular/compiler": "11.2.0",
    "@angular/core": "11.2.0",
    "@angular/forms": "11.2.0",
    "@angular/platform-browser": "11.2.0",
    "@angular/platform-browser-dynamic": "11.2.0",
    "@angular/router": "11.2.0",
    "ngx-mask": "9.1.2",
    "rxjs": "6.6.3",
    "tslib": "2.1.0",
    "zone.js": "0.11.3"
  },

Anything else relevant?

@florinsuman florinsuman changed the title Cursor jumps at beginning then the model is set Cursor jumps at beginning ifthe model is set Mar 22, 2022
@timrasche
Copy link

Confirm with newest Version and Angular 13.3.2

pretty annoying...

@berubemartin
Copy link

I have the same bug with latest version and Angular latest version too !

@berubemartin
Copy link

The issues still here again ! If you press '-', the cursor jump at the beginning of the input IF THE ngModel is binded. If no ngModel is binded then input acts correctyl

@GlebChiz
Copy link
Contributor

@berubemartin This issue has not yet been fixed. I'll fix this in the next few days.

GlebChiz added a commit that referenced this issue May 17, 2022
NepipenkoIgor pushed a commit that referenced this issue May 18, 2022
* fix(#984): cursor jumps at beginning if input '0' or '-'

* fix(#984): tests added, version updated, changelog updated
@NepipenkoIgor
Copy link
Collaborator

@florinsuman @timrasche @berubemartin Thank you for using ngx-mask. Please try version >=13.1.14

smfukaya pushed a commit to smfukaya/ngx-mask that referenced this issue Aug 8, 2023
@dinbtechit
Copy link

still an issue in 15.2.3

Kapture 2024-03-06 at 12 51 47

@NepipenkoIgor NepipenkoIgor reopened this Mar 6, 2024
@andriikamaldinov1
Copy link
Collaborator

@dinbtechit Thanks for using Ngx-mask.
It example with your mask, all work as expected - https://stackblitz.com/edit/angular-15-starter-pack-rpkdyd?file=src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

If you have any questions or bugs, open new issues by teamplate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants