Skip to content

Commit

Permalink
[indexPatterns] update field in place (#11966)
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed May 24, 2017
1 parent d4be917 commit df2fb14
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ui/public/field_editor/field_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ uiModules
const fields = indexPattern.fields;
const field = self.field.toActualField();

fields.remove({ name: field.name });
fields.push(field);
const index = fields.findIndex(f => f.name === field.name);
if (index > -1) {
fields.splice(index, 1, field);
} else {
fields.push(field);
}

if (!self.selectedFormatId) {
delete indexPattern.fieldFormatMap[field.name];
Expand Down

0 comments on commit df2fb14

Please sign in to comment.