Skip to content

Weird default value behaviourΒ #11

@VojtaStanek

Description

@VojtaStanek

I have following schema:

export class Article {
	// [...]
	publishedAt = def.dateTimeColumn()
	// [...]
}

Admin definition:

<DateField
	field="publishedAt"
	label="Published at"
	dateFormat="d. M. yyyy"
	defaultValue={new Date().toISOString()}
/>

Current behaviour

When editing entity which has publishedAt set to null administration shows the field filled with specified default value and save button is disabled. When the field is cleared, the save button is enabled and persists the default value.

Expected behaviour

a) After clearing the field, it shouldn't persist anything and the button should be disabled.
b) Before clearing the field, the button shouldn't be disabled.

Admin version: 0.6.52

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