Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird default value behaviour #11

Open
VojtaStanek opened this issue Aug 6, 2021 · 0 comments
Open

Weird default value behaviour #11

VojtaStanek opened this issue Aug 6, 2021 · 0 comments

Comments

@VojtaStanek
Copy link
Contributor

VojtaStanek commented Aug 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant