Skip to content

Datepicker Issue in Angular formly #115

@uideveloper569

Description

@uideveloper569

Hi @kentcdodds/Team,

I am trying to generate a form using angular-formly with the below field's json.

vm.fields = [
{
key: 'first_name',
type: 'input',
templateOptions: {
type: 'text',
label: 'First Name',
placeholder: 'Enter your first name',
required: true
}
},
{
key: 'date1',
type: 'datepicker',
templateOptions: {
label: 'Date 1',
type: 'text',
required:true,
datepickerPopup: 'dd-MMMM-yyyy'
}
}];

It is generating two fields i.e. input and date picker.

My issue is whenever i click on date field for the first time, it is indicating error like required field and cannot be left empty.

This error should come only when i leave the field, not when i clicked on the date picker and about to select some date from the calendar.

If you see for the first field "first name", when i click on the field for the first time it is not indicating any error till i leave the field empty. Once the blur event is fired, then only we can see that it is highlighted indicating required field cannot be left empty.

Is there any way that we can stop date picker field indicating error before i made any date selection from calender?

Thanks,

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions