File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
lib/core/src/lib/form/components/widgets/core Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,7 @@ export class RequiredFieldValidator implements FormFieldValidator {
6969 return ! ! field . value ;
7070 }
7171
72- if ( field . value === null || field . value === undefined || field . value === '' ) {
73- return false ;
74- }
75-
76- if ( typeof field . value === 'string' && field . value . trim ( ) . length === 0 ) {
72+ if ( field . isValueEmpty ( ) ) {
7773 return false ;
7874 }
7975 }
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ export class FormFieldModel extends FormWidgetModel {
178178 return this . _isValid ;
179179 }
180180 }
181- } else if ( this . readOnly && this . _required && ! this . form ?. isFieldOrParentHidden ( this ) && this . isValueEmpty ( ) ) {
181+ } else if ( this . readOnly && this . required && ! this . form ?. isFieldOrParentHidden ( this ) && this . isValueEmpty ( ) ) {
182182 this . _isValid = false ;
183183 return this . _isValid ;
184184 }
@@ -190,7 +190,7 @@ export class FormFieldModel extends FormWidgetModel {
190190 return ! this . readOnly || FormFieldTypes . isValidatableType ( this . type ) ;
191191 }
192192
193- private isValueEmpty ( ) : boolean {
193+ isValueEmpty ( ) : boolean {
194194 if ( this . value === null || this . value === undefined || this . value === '' ) {
195195 return true ;
196196 }
You can’t perform that action at this time.
0 commit comments