Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Field have to be able to add defaultValue from props #58

Closed
chilijung opened this issue Aug 14, 2018 · 0 comments · Fixed by #83
Closed

Field have to be able to add defaultValue from props #58

chilijung opened this issue Aug 14, 2018 · 0 comments · Fixed by #83
Assignees
Labels
discussion This issue is still under discussion enhancement New feature or request Important Important feature need to support
Milestone

Comments

@chilijung
Copy link
Contributor

chilijung commented Aug 14, 2018

Current mechanism directly shows value from source and update value to the source. But sometimes it's not enough.

But in some cases, we might need to insert a defaultValue from Canner schema.

let's say, we need a form to create a product, and the productId should generate while I click the add button and also it should be disabled so users is not allow to change it. So in order to do that I'll add a schema as below.

<string
  keyName="productId"
  disabled
  defaultValue={() => shortId.generate()...}/> // I could use shortId or timestamp to generate a immutable defaultValue.
@chilijung chilijung added enhancement New feature or request Important Important feature need to support discussion This issue is still under discussion labels Aug 14, 2018
@chilijung chilijung added this to the v1.5.x milestone Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion This issue is still under discussion enhancement New feature or request Important Important feature need to support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants