Skip to content

Commit e395271

Browse files
authored
fix: fix error on width change of AnimatedFAB when label is empty string (#4729)
1 parent aae6e42 commit e395271

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/FAB/AnimatedFAB.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ const AnimatedFAB = ({
335335
const onTextLayout = ({
336336
nativeEvent,
337337
}: NativeSyntheticEvent<TextLayoutEventData>) => {
338-
const currentWidth = Math.ceil(nativeEvent.lines[0].width);
339-
const currentHeight = Math.ceil(nativeEvent.lines[0].height);
338+
const currentWidth = Math.ceil(nativeEvent.lines[0]?.width ?? 0);
339+
const currentHeight = Math.ceil(nativeEvent.lines[0]?.height ?? 0);
340340

341341
if (currentWidth !== textWidth || currentHeight !== textHeight) {
342342
setTextHeight(currentHeight);

0 commit comments

Comments
 (0)