Skip to content

Commit

Permalink
[Advanced settings] Fix resetting image values (elastic#131610) (elas…
Browse files Browse the repository at this point in the history
…tic#131878)

* fix resetting image values in advanced settings

* update test

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit dc38f08)
  • Loading branch information
jloleysens authored May 9, 2022
1 parent f4b6179 commit 56fabe0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ describe('Field', () => {
const updated = wrapper.update();
findTestSubject(updated, `advancedSetting-resetField-${setting.name}`).simulate('click');
expect(handleChange).toBeCalledWith(setting.name, {
value: getEditableValue(setting.type, setting.defVal),
value: getEditableValue(setting.type, setting.defVal, setting.defVal),
changeImage: true,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Field extends PureComponent<FieldProps> {
if (type === 'image') {
this.cancelChangeImage();
return this.handleChange({
value: getEditableValue(type, defVal),
value: getEditableValue(type, defVal, defVal),
changeImage: true,
});
}
Expand Down

0 comments on commit 56fabe0

Please sign in to comment.