Skip to content

Commit

Permalink
upgrade to 0.8.6 and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu committed Apr 24, 2020
1 parent 5e845cd commit 5d4360d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

## 0.8.6 - 2019-04-24
### Added

### Changed
- fixes #195 add setDefault to populate default value from the Select constructor

## 0.8.5 - 2019-04-21
### Added

Expand Down
9 changes: 7 additions & 2 deletions lib/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ function (_Component) {

var _this$props3 = _this.props,
model = _this$props3.model,
form = _this$props3.form;
form = _this$props3.form,
setDefault = _this$props3.setDefault,
_key = _this$props3.form.key;
var defaultValue = form && form.selectProps && form.selectProps.multiple ? [] : "";

if (props.form["default"]) {
Expand All @@ -113,9 +115,12 @@ function (_Component) {
defaultValue = props.form.schema["default"];
}

var _currentValue = _utils["default"].getValueFromModel(model, form.key) || defaultValue;

_this.state = {
currentValue: _utils["default"].getValueFromModel(model, form.key) || defaultValue
currentValue: _currentValue
};
setDefault(_key, model, form, _currentValue);
return _this;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-schema-form",
"version": "0.8.5",
"version": "0.8.6",
"description": "React json schema form",
"keywords": [
"json schema",
Expand Down

0 comments on commit 5d4360d

Please sign in to comment.