TextboxVariable: Limits the length of the preview value (#32472)

This commit is contained in:
Hugo Häggmark
2021-03-31 06:59:43 +02:00
committed by GitHub
parent 904187eb5a
commit 2def9a8172

View File

@@ -35,7 +35,7 @@ export const VariableValuesPreview: React.FunctionComponent<VariableValuesPrevie
{previewOptions.map((o, index) => (
<InlineFieldRow key={`${o.value}-${index}`} className={styles.optionContainer}>
<InlineLabel aria-label={selectors.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption}>
{o.text}
<div className={styles.label}>{o.text}</div>
</InlineLabel>
</InlineFieldRow>
))}
@@ -63,5 +63,11 @@ function getStyles(theme: GrafanaTheme) {
margin-left: ${theme.spacing.xs};
margin-bottom: ${theme.spacing.xs};
`,
label: css`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 50vw;
`,
};
}