Comments (5)
What field are you using?
from simple-react-form.
schema = new SimpleSchema({
name: {
type: String,
defaultValue: 'test'
}
})
<Form schema={schema} type="insert">
<Field fieldName="name" type={Text}>
</Form>
I suggest, input text box "name" should be prefill with "test" value... like it does autoform
from simple-react-form.
Yes it should. This will come in a next update
from simple-react-form.
Ok, thank you very much! Im looking forward this feature...
from simple-react-form.
It's better to add defaultValue as a Field component prop because defining defaultValue in SimpleSchema currently does not prevent validation errors when calling schema's validate() method (that's what SRF uses for SimpleSchema during submittion of the form).
I'm currently doing it like this:
<Field fieldName="schemaFieldName" type={MUI_SRF_customField} defaultValue="test" />
and in MUI_SRF_customField component:
export default class MUI_SRF_customField extends simpleReactFormMaterialUiCmp {
constructor(props) {
super(props);
if (this.props.passProps.defaultValue) {
// for some reason synchronous onChange call does not set State in Form
setTimeout(() => {
this.props.onChange(this.props.passProps.defaultValue);
}, 0);
}
}
}
from simple-react-form.
Related Issues (20)
- Issues over on simple-react-form-material-ui
- Sharing Custom Field Componets HOT 1
- Add support to latest Simple Schema HOT 1
- Pre-submit hook HOT 3
- Validation HOT 1
- Cannot read property propTypes of null HOT 1
- React native with Array field: 'There is no field "parentField.0.0.childField" in the schema'
- SSR: ReferenceError: navigator is not defined
- simple-react-form problem with textfields? HOT 3
- Wrong Mongo modifier format for update form with commitOnlyChanges={true} HOT 1
- Need Maintenance Help? HOT 1
- Uncaught Error: There is no field "Sections.0.0.SectionName" in the schema. HOT 2
- Validation Issue HOT 3
- Remove Depend React Native HOT 2
- Problems with some types HOT 1
- Why need AttachSchema ? HOT 1
- React v15 compatibility? HOT 1
- Specifying onChange for a field blocks that field's value from being passed to the form's onChange. HOT 1
- Should be able to get the value of the form
- How to Display ServerSide validation errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-react-form.