Skip to content

Commit

Permalink
ver. 0.4.23
Browse files Browse the repository at this point in the history
  • Loading branch information
qili.taoqili committed Dec 16, 2019
1 parent 87307d2 commit 94d24f3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.4.23
* `CHANGE` add title which is different with label for option

## 0.4.20
* `CHANGED` fix a bug when fetchMethod is not set

Expand Down
2 changes: 1 addition & 1 deletion demo/SelectFormFieldDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Demo extends React.Component {
<div style={{ margin: 50 }}>
<Form
jsxmode={me.state.mode}
jsxvalues={{ numberSelect: 2, city: this.state.value, city2: '*', select4: 'nj', select5: 'aj1' }}
jsxvalues={{ numberSelect: 2, city: this.state.value, city2: '*', select4: 'nj', select5: {key: 11, label: '222', title: '22233'}}}
jsxonChange={this.change}
>
<FormRow>
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": "uxcore-select-form-field",
"version": "0.4.22",
"version": "0.4.23",
"description": "uxcore-select-form-field component for uxcore.",
"repository": "https://github.com/uxcore/uxcore-select-form-field.git",
"author": "eternalsky",
Expand Down
1 change: 1 addition & 0 deletions src/SelectFormField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class SelectFormField extends FormField {
return {
key: newValue.value || newValue.key,
label: newValue.text || newValue.label,
title: newValue.title || newValue.text || newValue.label
};
}
return newValue;
Expand Down
2 changes: 2 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ const processData = (data) => {
values = keys.map(key => ({
value: key,
text: data[key],
title: data.title || data.label || data.text
}));
} else {
values = data.map((item) => {
const newItem = {
...item,
value: item.key || item.value,
text: item.label || item.text,
title: item.title || item.label || item.text
};
['key', 'label'].forEach((key) => {
delete newItem[key];
Expand Down

0 comments on commit 94d24f3

Please sign in to comment.