From c9170b1435534df771491bcd1b8fd94220dd17ed Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:21:35 +0100 Subject: [PATCH] [v11.2.x] UI/AutoSizeInput: Fixes issue where controlledValue being null caused crash (#94089) UI/AutoSizeInput: Fixes issue where controlledValue being null caused crash (#94078) (cherry picked from commit 1b82595251023ab80490d99811d5f81e4b7290e1) Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> --- packages/grafana-ui/src/components/Input/AutoSizeInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/Input/AutoSizeInput.tsx b/packages/grafana-ui/src/components/Input/AutoSizeInput.tsx index 6e5b4ccd837..de855ff5302 100644 --- a/packages/grafana-ui/src/components/Input/AutoSizeInput.tsx +++ b/packages/grafana-ui/src/components/Input/AutoSizeInput.tsx @@ -32,7 +32,7 @@ export const AutoSizeInput = React.forwardRef((props, r // Update internal state when controlled `value` prop changes useEffect(() => { - if (controlledValue !== undefined) { + if (controlledValue) { setValue(controlledValue); } }, [controlledValue]);