File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
rest_framework_docs/static/rest_framework_docs/js Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ var AddFieldsForm = React.createClass({
1111 } ,
1212
1313 addField : function ( ) {
14- this . props . onAdd ( this . state . fieldName ) ;
15- this . setState ( {
16- fieldName : ''
17- } ) ;
14+ if ( this . state . fieldName ) {
15+ this . props . onAdd ( this . state . fieldName ) ;
16+ this . setState ( {
17+ fieldName : ''
18+ } ) ;
19+ }
1820 } ,
1921
2022 handleKeyPress : function ( event ) {
@@ -36,12 +38,12 @@ var AddFieldsForm = React.createClass({
3638 < Header title = 'Add Extra Fields' />
3739
3840 < div className = 'form-group' >
39- < label className = 'col-sm-4 control-label' > Add Field</ label >
41+ < label className = 'col-sm-4 control-label' > Field Name </ label >
4042 < div className = "col-sm-6" >
4143 < input
4244 type = 'text'
4345 className = 'form-control input-sm'
44- placeholder = 'Field Name ( ie. email_address) '
46+ placeholder = 'ie. email_address'
4547 onKeyPress = { this . handleKeyPress }
4648 onChange = { this . handleChange }
4749 value = { this . state . fieldName } />
You can’t perform that action at this time.
0 commit comments