imaskjs icon indicating copy to clipboard operation
imaskjs copied to clipboard

Angular HRM restores input fields, shows duplicate values

Open superman-lopez opened this issue 3 years ago • 0 comments

Describe the bug I am using the Angular plugin. In my development environment I am using the HRM function of Angular serve. When a HRM is triggered, Angular tries to reenter the values of the input fields as they were at the time of the refresh. However the masking is not applied to this, and the value gets corrupted.

To Reproduce

		mask = {
			mask: Number,
			scale: 2,
			padFractionalZeros: true,
			signed: true,
			radix: ".",
			thousandsSeparator: ",",
			mapToRadix: [".", ","]
		};

Load a page with an input that has a value retrieved from database (say "7"). At first the value is correctly masked as "7.00", but after the HRM tries to put in the original value (console shows: [NG HMR] Restoring input/textarea values.) the value in the input value is shown as "7,007.00". My computer has "." as the decimal indicator.

Expected behavior The HRM refresh input change is accepted as input change and the value is masked correctly.

Environment:

  • OS: macOS
  • Browser: Chromium
  • Version 90.0.4430.214
  • IMask version: angular-imask 6.1.0
  • Framework/plugin version if used: angular-imask

superman-lopez avatar Jul 14 '21 08:07 superman-lopez