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
{{ message }}
Repository navigation
wrong value using Switch or TextField(!) in combination with updateOn: 'blur' #1362
Hi @gms1,
Thank you for the sample project.
I tested this case while using the Switch component with '@angular/forms'. Indeed the valueChanges method will not be executed on first Switch value change. For further info, please keep track on the issue.
regarding Switch and other controls, I wondered how an "updateOn: blur" could work, as long as there are no focus/blur events from the underlying framework for these controls.
However, I am getting a similar behavior using Textfield, although focus/blur events are fully supported for this control.
In the repo there is now a new folder 'testfield-updateOnBlur' with which the problem with TextField can be reproduced.
Should I open a new issue for TextField?
For Switch / Slider, ... this feature may not be that important, but with TextField we are now forced to unnecessarily validate all typos, or to implement a workaround every time that bypasses the standard validation
changed the title [-]wrong value using Switch in combination with updateOn: 'blur' [/-][+]wrong value using Switch or TextField(!) in combination with updateOn: 'blur' [/+]on Jun 11, 2018
* On blur (or equivalent), your class should call the registered function to allow
* the forms API to update itself:
*
* ```ts
* host: {
* '(blur)': '_onTouched()'
* }
* ```
Activity
tsonevn commentedon Jun 4, 2018
Hi @gms1,
Thank you for the sample project.
I tested this case while using the Switch component with '@angular/forms'. Indeed the
valueChangesmethod will not be executed on first Switch value change. For further info, please keep track on the issue.gms1 commentedon Jun 10, 2018
Hi @tsonevn,
regarding Switch and other controls, I wondered how an "updateOn: blur" could work, as long as there are no focus/blur events from the underlying framework for these controls.
However, I am getting a similar behavior using Textfield, although focus/blur events are fully supported for this control.
In the repo there is now a new folder 'testfield-updateOnBlur' with which the problem with TextField can be reproduced.
Should I open a new issue for TextField?
For Switch / Slider, ... this feature may not be that important, but with TextField we are now forced to unnecessarily validate all typos, or to implement a workaround every time that bypasses the standard validation
[-]wrong value using Switch in combination with updateOn: 'blur' [/-][+]wrong value using Switch or TextField(!) in combination with updateOn: 'blur' [/+]gms1 commentedon Jun 11, 2018
added TextField to the title
however, it is possible that the TextField-issue already has a solution:
#1230
see ControlValueAccessor
gms1 commentedon Jun 11, 2018
verified: #1230 solves the TextField-part of this issue!