mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
Canvas: Unable to add fixed text in textbox element #53080
This commit is contained in:
parent
5fb778814c
commit
c00c8db13c
@ -59,12 +59,15 @@ export const TextDimensionEditor: FC<StandardEditorProps<TextDimensionConfig, Te
|
|||||||
...value,
|
...value,
|
||||||
fixed,
|
fixed,
|
||||||
});
|
});
|
||||||
|
|
||||||
setRefresh(refresh + 1);
|
|
||||||
},
|
},
|
||||||
[onChange, refresh, value]
|
[onChange, value]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const onClearFixed = () => {
|
||||||
|
onFixedChange('');
|
||||||
|
setRefresh(refresh + 1);
|
||||||
|
};
|
||||||
|
|
||||||
const mode = value?.mode ?? TextDimensionMode.Fixed;
|
const mode = value?.mode ?? TextDimensionMode.Fixed;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -95,9 +98,7 @@ export const TextDimensionEditor: FC<StandardEditorProps<TextDimensionConfig, Te
|
|||||||
onChange={onFixedChange}
|
onChange={onFixedChange}
|
||||||
item={dummyStringSettings}
|
item={dummyStringSettings}
|
||||||
suffix={
|
suffix={
|
||||||
value?.fixed && (
|
value?.fixed && <Button icon="times" variant="secondary" fill="text" size="sm" onClick={onClearFixed} />
|
||||||
<Button icon="times" variant="secondary" fill="text" size="sm" onClick={() => onFixedChange('')} />
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</InlineField>
|
</InlineField>
|
||||||
|
Loading…
Reference in New Issue
Block a user