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

OutputTransformFn is not used when setting an empty value #1456

Open
angheladrian opened this issue Nov 12, 2024 · 0 comments
Open

OutputTransformFn is not used when setting an empty value #1456

angheladrian opened this issue Nov 12, 2024 · 0 comments

Comments

@angheladrian
Copy link

When a OutputTransformFn function is configured, this is not always called when the control value is set programmatically.

Is this a regression?

Works fine with version 8.0.2

I would say it was introduced with the fix for #1447

Description

🔬 Minimal Reproduction

Consider having an input:

<input type="text" formControlName="amount" mask="separator.0">

When setting the values in code:

form.amount.setValue(null)

Then the OutputTransformFn is not called.

I think the problem is in NgxMaskService.formControlResult method.
Correct would be: this.onChange(this.outputTransformFn(''));

🌍 Your Environment

Angular Version:


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

No branches or pull requests

1 participant