[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 1b82595251)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-10-01 16:21:35 +01:00
committed by GitHub
co-authored by kay delaney
parent f61a60f54b
commit c9170b1435
@@ -32,7 +32,7 @@ export const AutoSizeInput = React.forwardRef<HTMLInputElement, Props>((props, r
// Update internal state when controlled `value` prop changes
useEffect(() => {
if (controlledValue !== undefined) {
if (controlledValue) {
setValue(controlledValue);
}
}, [controlledValue]);