You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the ColorScales component, the colorscale default changes to the latest selection as the ColorscalePicker is initialized again with a colorscale prop that has been changed. The ColorscalePicker should always be initialized with the original input colorscale prop (if available). Also, the nSwatches should rather be nSwatches || colorscale.length || DEFAULT_SCALE.length to use the input colorscale length as default if nSwatches is not defined in input, and colorscale is.
Something that works is to do change the constructor to:
When using the ColorScales component, the colorscale default changes to the latest selection as the ColorscalePicker is initialized again with a colorscale prop that has been changed. The ColorscalePicker should always be initialized with the original input colorscale prop (if available). Also, the nSwatches should rather be
nSwatches || colorscale.length || DEFAULT_SCALE.length
to use the input colorscale length as default if nSwatches is not defined in input, and colorscale is.Something that works is to do change the constructor to:
and switch input in ColorscalePicker to
but not sure if it is the "right" way to solve such issues in React/JS.
webviz-core-components/src/lib/components/ColorScales/ColorScales.jsx
Lines 53 to 54 in e3e8666
The text was updated successfully, but these errors were encountered: