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

ObMandatoryDirective generates constant stream of control value changes #45

Closed
ufleisch opened this issue Sep 29, 2021 · 4 comments
Closed
Labels
bug Something isn't working validated The issue will be fixed
Milestone

Comments

@ufleisch
Copy link

With Oblique 7, the new module ObMandatoryModule instruments form controls with a validator but without required attribute with a ngAfterContentChecked hook, which generates a constant stream of events generated by updateValueAndValidity().

We have a project which does no longer work after the migration to Oblique 7 because it uses several custom validators and valueChanges handlers on controls. For example, when a location is set in a form, its valueChanges handler sets latitude and longitude in other controls. Now this handler is constantly called thereby overwriting the values. Other controls are affected as well, it is no longer possible to enter any values into the controls. As a workaround, we no longer import the whole ObliqueModule but only the effectively used sub modules, so that ObMandatoryModule is not active.

This behavior could be improved. The updateValueAndValidity() could only be triggered and this.formFieldControl.required could only be set when its value has really changed.

Additionally, in selector: 'input:not([required]), mat-select:not([required),... a closing ] seems to be missing.

@c-saner
Copy link
Collaborator

c-saner commented Sep 29, 2021

Hello,

Thank you for your input.

We'll look into your improvement suggestion.

Kind regards

@c-saner c-saner added the bug Something isn't working label Sep 29, 2021
@gillerr gillerr added the validated The issue will be fixed label Sep 29, 2021
@gillerr
Copy link
Collaborator

gillerr commented Nov 3, 2021

According to angular/components#2574, the goal of the ObMandatoryModule is now covered directly by Angular. If this is really the case, then we'll remove the feature altogether.

@gillerr gillerr added this to the 8.0.0 milestone Nov 3, 2021
@gillerr
Copy link
Collaborator

gillerr commented Dec 17, 2021

The ObMandatoryModule will be removed with Oblique 8 as Angular 13 takes care of that.

@gillerr
Copy link
Collaborator

gillerr commented Feb 14, 2022

The ObMandatoryModule has been removed with Oblique 8

@gillerr gillerr closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validated The issue will be fixed
Projects
None yet
Development

No branches or pull requests

3 participants