-
Notifications
You must be signed in to change notification settings - Fork 591
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
set def field value for visible fields #4716
Conversation
const field = schema.find(field => field.name === name); | ||
const def = field && klona((field.def !== undefined) ? field.def : self.fieldTypes[field.type]?.def); | ||
if (def) { | ||
destination[field.name] = def; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the place to do it. The front end should be honoring the defaults it already has and is already showing. Trying to force defaults at save time server side will be a regression to something we already agreed is bad: forcing the use of defaults when people intentionally clear fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear I am saying this a front end bug that needs a front end fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear: the front end should actually send the values it is initially displaying, whether those specific fields get touched or not. Not just those for fields the user moves the focus to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that the problem has something to do with the way the object
field's v-model
is implemented.
This reverts commit 105fe05.
b2a6b80
to
93e1d72
Compare
Summary
Summarize the changes briefly, including which issue/ticket this resolves. If it closes an existing Github issue, include "Closes #[issue number]"
What are the specific steps to test this change?
For example:
What kind of change does this PR introduce?
(Check at least one)
Make sure the PR fulfills these requirements:
If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.
Other information: