Validator checking "empty" value of hex color not working properly
striky1 opened this issue · comments
Describe the bug
When you using directives (MccColorPickerOrigin and MccConnectedColorPicker) on basic text input with RXJS forms and you want to check if is input empty (required) there is a problem when you have some value, e.g. #fff
, and you selected whole value, then clicked delete/backspace and then in formControl you will have still same value #fff
BUT if you will erase value with character by character (eg. #fff
=> #ff
=> #f
=> #
=> ''
) in form will be just value #
what is ok because you can write custom Form Validator.
To Reproduce
Steps to reproduce the behavior:
- Make basic form with one input and custom validator which will check if value is
#
and if, input is invalid - Select whole value in input and delete it with backspace or delete keyboard
- Form is valid!
When it works:
- Same as 1. point in previous steps
- Delete character by character
- Form is invalid
Expected behavior
Should works with whole value delete
Desktop (please complete the following information):
- OS: macOS High Sierra 10.13.6
- Browser: Chrome v68.0.3440.106
- Material Community Components: v3.2.1
This is still happening in v6.0.0?
Hi 👋 @tiaguinho / @motabass ,
sorry for late response. I checked it on version 7.1.0
and it's worse than before.
Right now User is not able to reset value in Reactive Form Fields at all. If User will use backspace, Form Field will have value as shorthand of some color. If User will select whole value and then hit delete/backspace button, Form Field will have same value as before.
StackBlitz: https://stackblitz.com/edit/angular-ivy-zb3mau?file=src/app/app.component.html
Thank you for your reply.
striky..
@striky1 did you also try 9.0.0?
Seems as if it's gone in 9.0.0:
https://stackblitz.com/edit/angular-ivy-w3zrem?file=src/app/app.module.ts