Devextreme-angular: DateBox - Internal validation is not bubbled up to an Angular form control

Created on 18 May 2017  路  2Comments  路  Source: DevExpress/devextreme-angular

To help us process the issue more efficiently, please provide the following information:

  • Specify the version of the devextreme-angular and devextreme packages you are using.
devexteme version: 16.2
devextreme-angular version: 16.2

  • Specify the type of the issue (check one with "x"):
    [x] bug Report
    [ ] feature requestspecify expected results. -->
    [ ] support inquiry

Please consider the following example: http://plnkr.co/edit/aUgSLuJ4YVQFzV77eba1?p=preview

Notice the date-box has a minimum range set to 1st May 2017, you are unable to select a value from the date picker, however if you enter via the keyboard 1st April 2017 this is accepted by the input control. However the control validation kicks in and shows an error icon. If you review the output below neither the formGroup for formControl associated with the datebox are marked as invalid.

question

Most helpful comment

This is still an issue. A FormControl that has a red exclamation mark in the UI because of wrong input but still has valid: true is definitely not the expected behavior.

All 2 comments

Hi,

dxDateBox has the internal validation mechanism, which doesn't raise the default valueChanged event in the described case. I suggest you manually track changes of the isValid option using the onOptionChanged handler and create a custom validator that will take these changes into account. Please take a look at the following code example -

validation.zip

Plunker - http://plnkr.co/edit/fjrwBA0JoPMPK127z02V?p=preview

Anyway, we understand that this solution doesn't look generic and consider improving our existing integration mechanisms in future versions.

This is still an issue. A FormControl that has a red exclamation mark in the UI because of wrong input but still has valid: true is definitely not the expected behavior.

Was this page helpful?
0 / 5 - 0 ratings