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

field.value doesn't use options.defaultValue when it is a function #118

Closed
glutentag opened this issue Jun 16, 2016 · 0 comments
Closed

Comments

@glutentag
Copy link
Contributor

glutentag commented Jun 16, 2016

Hello,

When field.value is a function, it uses field.default as a default value but doesn't use options.defaultValue.
Also, if the function returns a falsy value, it is replaced by the default value.

It is from this line:

} else if (fieldElement && typeof fieldElement.value === 'function') {
  val = fieldElement.value(dataElement) || fieldElement.default;
}
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