[Controls] Fix range slider control diffing (#174394)

Fixes https://github.com/elastic/kibana/issues/174396

## Summary

Fixes bug where certain changes to range slider controls would not
trigger unsaved changes.

Before:


e7434a96-f79e-4a86-b538-5ffddb6c9bd9


After: 


e2f98df4-4eee-459a-aa99-c1296ed879f7
This commit is contained in:
Nick Peihl 2024-01-09 14:16:47 -05:00 committed by GitHub
parent 315cf9d399
commit affa373d50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,11 +34,11 @@ export const ControlPanelDiffSystems: {
return false;
}
const { value: valueA = ['', ''] }: Partial<RangeSliderEmbeddableInput> =
const { value: valueA = ['', ''], ...inputA }: Partial<RangeSliderEmbeddableInput> =
initialInput.explicitInput;
const { value: valueB = ['', ''] }: Partial<RangeSliderEmbeddableInput> =
const { value: valueB = ['', ''], ...inputB }: Partial<RangeSliderEmbeddableInput> =
newInput.explicitInput;
return isEqual(valueA, valueB);
return isEqual(valueA, valueB) && deepEqual(inputA, inputB);
},
},
[OPTIONS_LIST_CONTROL]: {