Skip to content

Commit

Permalink
Fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
kaivi committed Jun 3, 2017
1 parent f2721ab commit 3b15f54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@
change: _this.virtualServerCallback,
propName: 'text',
className: _this.state.highlight ? "editable" : "",
validate: _this.isStringAcceptable,
classLoading: 'loading',
classInvalid: 'invalid',
isDisabled: _this.state.isDisabled }),
Expand Down Expand Up @@ -19352,15 +19351,16 @@

_this.doValidations = function (value) {
debug('doValidations(' + value + ')');
var result = void 0;
var isValid = void 0;
if (_this.props.validate) {
result = _this.props.validate(value);
debug('using this.props.validate');
isValid = _this.props.validate(value);
} else if (_this.validate) {
result = _this.validate(value);
}
_this.setState({ invalid: !result });

return result;
debug('using this.validate');
isValid = _this.validate(value);
} else return true;
_this.setState({ invalid: !isValid });
return isValid;
};

_this.selectInputText = function (element) {
Expand Down
1 change: 0 additions & 1 deletion demo/demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ isDisabled={this.state.isDisabled} />`}
change={this.virtualServerCallback}
propName="text"
className={this.state.highlight ? "editable" : ""}
validate={this.isStringAcceptable}
classLoading="loading"
classInvalid="invalid"
isDisabled={this.state.isDisabled} />
Expand Down
15 changes: 8 additions & 7 deletions src/RIEBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ export default class RIEBase extends React.Component {

doValidations = (value) => {
debug(`doValidations(${value})`)
let result;
let isValid;
if(this.props.validate) {
result = this.props.validate(value);
debug('using this.props.validate')
isValid = this.props.validate(value);
} else if (this.validate) {
result = this.validate(value);
}
this.setState({invalid: !result});

return result;
debug('using this.validate')
isValid = this.validate(value);
} else return true
this.setState({invalid: !isValid});
return isValid;
};

selectInputText = (element) => {
Expand Down

0 comments on commit 3b15f54

Please sign in to comment.