GraphNG: improve behavior when switching between solid/dash/dots (#30796) (#30799)

(cherry picked from commit fcac59107c)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-02-01 10:07:17 -08:00
committed by GitHub
co-authored by Ryan McKinley
parent 4fc57f13ab
commit 6c9e8549ca
@@ -73,9 +73,16 @@ export const LineStyleEditor: React.FC<FieldOverrideEditorProps<LineStyle, any>>
value={value?.fill || 'solid'}
options={lineFillOptions}
onChange={(v) => {
let dash: number[] | undefined = undefined;
if (v === 'dot') {
dash = parseText(dotOptions[0].value!);
} else if (v === 'dash') {
dash = parseText(dashOptions[0].value!);
}
onChange({
...value,
fill: v!,
dash,
});
}}
/>