Graphite: Fix overflow of functions editor (#108524)

* Expose setting labelStyles for the Segment components

* Ensure container fills height of text

* Update label styles

* Use classNames instead

* Review

* Lint
This commit is contained in:
Andreas Christou
2025-07-29 11:16:32 +01:00
committed by GitHub
parent 3c4c3b3f5c
commit c32aaf63e8
3 changed files with 15 additions and 1 deletions
@@ -22,6 +22,8 @@ const getStyles = (theme: GrafanaTheme2) => {
fontSize: theme.typography.bodySmall.fontSize,
cursor: 'pointer',
display: 'inline-block',
overflowWrap: 'anywhere',
height: '100%',
}),
};
};
@@ -55,7 +55,13 @@ export function FunctionParamEditor({ editableParam, onChange, onExpandedChange,
}}
onExpandedChange={onExpandedChange}
// input style
style={{ height: '25px', paddingTop: '2px', marginTop: '2px', paddingLeft: '4px', minWidth: '100px' }}
style={{
height: '25px',
paddingTop: '2px',
marginTop: '2px',
paddingLeft: '4px',
minWidth: '100px',
}}
></SegmentInput>
);
}
@@ -65,6 +71,8 @@ const getStyles = (theme: GrafanaTheme2) => ({
segment: css({
margin: 0,
padding: 0,
overflowWrap: 'anywhere',
height: '100%',
}),
input: css({
margin: 0,
@@ -72,5 +80,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
input: {
height: '25px',
},
overflowWrap: 'anywhere',
height: '100%',
}),
});
@@ -41,6 +41,8 @@ export function GraphiteFunctionEditor({ func }: FunctionEditorProps) {
onFocus={() => setIsMouseOver(true)}
onMouseOver={() => setIsMouseOver(true)}
onMouseOut={() => setIsMouseOver(false)}
// We set this to ensure if any long text wraps the container expands with it
style={{ height: '100%' }}
>
<Stack gap={0} alignItems={'baseline'}>
<FunctionEditor