Skip to content

Move 'date' from type IField.type to Attributes.type #65

@sebastianfiss-consid

Description

@sebastianfiss-consid

The 'date' in IField.type is not handled correctly. There is no component for Date, so nothing will be rendered if I specify that. Furthermore, I can't specify it as a type for the input component.

Example:

	const fields: IField[] = [
		{
			type: 'date', // wont work
			name: 'dob',
			attributes: {
				// type: 'date', // cant specify that
				id: 'dob', // required
				classes: ['form-control'],
				placeholder: 'DOB',
				autocomplete: 'off'
			},
		}
	];

...

<Formly fields={fields} {form_name} on:submit={onSubmit} />

Fix in types.ts

export interface IField {
    type: 'input' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'file' | 'autocomplete'; // remove 'date'
}

export interface Attributes {
    id: string;
    type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'range' | 'date'; // add 'date'
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions