From e547216b072cabf16123df23fc20a3ea85d798e1 Mon Sep 17 00:00:00 2001 From: rnigro-rwb <89093814+rnigro-rwb@users.noreply.github.com> Date: Mon, 12 May 2025 20:38:23 +0000 Subject: [PATCH] fix: fix error on width change of AnimatedFAB when label is empty string --- src/components/FAB/AnimatedFAB.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FAB/AnimatedFAB.tsx b/src/components/FAB/AnimatedFAB.tsx index 4cd05fda1d..540f80676f 100644 --- a/src/components/FAB/AnimatedFAB.tsx +++ b/src/components/FAB/AnimatedFAB.tsx @@ -328,8 +328,8 @@ const AnimatedFAB = ({ const onTextLayout = ({ nativeEvent, }: NativeSyntheticEvent) => { - const currentWidth = Math.ceil(nativeEvent.lines[0].width); - const currentHeight = Math.ceil(nativeEvent.lines[0].height); + const currentWidth = Math.ceil(nativeEvent.lines[0]?.width ?? 0); + const currentHeight = Math.ceil(nativeEvent.lines[0]?.height ?? 0); if (currentWidth !== textWidth || currentHeight !== textHeight) { setTextHeight(currentHeight);