Skip to content

Commit

Permalink
fix #1319
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed May 20, 2017
1 parent 7b5f6e7 commit 338424f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ const editor = function(editable, attr, format, editorClass, defaultValue, ignor

if (editable.type === 'select') {// process select input
let options = [];
const values = editable.options.values;
const { values, textKey, valueKey } = editable.options;
if (Array.isArray(values)) {// only can use arrray data for options
let text;
let value;
options = values.map((option, i) => {
if (typeof option === 'object') {
text = option.text;
value = option.value;
text = textKey ? option[textKey] : option.text;
value = valueKey ? option[valueKey] : option.value;
} else {
text = format ? format(option) : option;
value = option;
Expand Down

0 comments on commit 338424f

Please sign in to comment.