diff --git a/packages/grafana-ui/src/components/Input/Input.tsx b/packages/grafana-ui/src/components/Input/Input.tsx index 1240569cb57..09b113cf76b 100644 --- a/packages/grafana-ui/src/components/Input/Input.tsx +++ b/packages/grafana-ui/src/components/Input/Input.tsx @@ -64,12 +64,17 @@ export const Input = forwardRef((props, ref) => { const theme = useTheme2(); - const styles = getInputStyles({ theme, invalid: !!invalid, width: finalWidth }); + // Don't pass the width prop, as this causes an unnecessary amount of Emotion calls when auto sizing + const styles = getInputStyles({ theme, invalid: !!invalid }); const suffix = suffixProp || (loading && ); return ( -
+
{!!addonBefore &&
{addonBefore}
}
{prefix && ( @@ -125,7 +130,7 @@ export const getInputStyles = stylesFactory(({ theme, invalid = false, width }: css({ label: 'input-wrapper', display: 'flex', - width: width ? theme.spacing(width) : '100%', + width: width ? theme.spacing(width) : '100%', // Not used in Input, as this causes performance issues with auto sizing height: theme.spacing(theme.components.height.md), borderRadius: theme.shape.radius.default, '&:hover': {