Commit e9576853 by Torkel Ödegaard Committed by GitHub

Table: Fixes issue with fixed min and auto max with bar gauge cell (#31316)

parent debb82e1
...@@ -65,14 +65,20 @@ function getMinMaxAndDelta(field: Field): NumericRange { ...@@ -65,14 +65,20 @@ function getMinMaxAndDelta(field: Field): NumericRange {
}; };
} }
/**
* @internal
*/
export function getFieldConfigWithMinMax(field: Field, local?: boolean): FieldConfig { export function getFieldConfigWithMinMax(field: Field, local?: boolean): FieldConfig {
const { config } = field; const { config } = field;
let { min, max } = config; let { min, max } = config;
if (isNumber(min) && !isNumber(max)) {
return config; // noop if (isNumber(min) && isNumber(max)) {
return config;
} }
if (local || !field.state?.range) { if (local || !field.state?.range) {
return { ...config, ...getMinMaxAndDelta(field) }; return { ...config, ...getMinMaxAndDelta(field) };
} }
return { ...config, ...field.state.range }; return { ...config, ...field.state.range };
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment