You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some cases where we should allow only letters (say full name) and as the user types, we transform to uppercase.
Describe the solution you'd like
I'd like to have an option to transform value before masking.
<!-- the name could be any, it's just an idea -><inputmatInputformControlName="test" mask="S*" [transformer]="transformerFn">
transformerFn=(value: string)=>value.toLocaleUppercase();this.formGroup.get('test').valueChanges.subscribe(console.log);// fired only once, with the value uppercased
Describe alternatives you've considered
Well, while we could add a directive to perform its transformation by listening input event, but has the following drawback:
The valueChanges/(change) would be emitted twice. One for the value masked and another for the value uppercased. To try workaround this you could setValue passing { emitEvent: false }, however it would be a problem, because you'll have an outdated value in valueChanges/(change);
The text was updated successfully, but these errors were encountered:
🚀 feature request
There are some cases where we should allow only letters (say full name) and as the user types, we transform to uppercase.
Describe the solution you'd like
I'd like to have an option to transform value before masking.
Describe alternatives you've considered
Well, while we could add a directive to perform its transformation by listening
input
event, but has the following drawback:valueChanges
/(change)
would be emitted twice. One for the value masked and another for the value uppercased. To try workaround this you couldsetValue
passing{ emitEvent: false }
, however it would be a problem, because you'll have an outdated value invalueChanges/(change)
;The text was updated successfully, but these errors were encountered: