Skip to content

Commit ff588df

Browse files
committed
Fix landscape->portrait not restoring header original height
1 parent a51ba2d commit ff588df

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/components/CollapsibleHeaderOnKeyboard/index.native.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function CollapsibleHeaderOnKeyboard({children, collapsibleHeaderOffset = 0}: Co
8282
// Portrait mode — no collapse needed. Snap to full height in case orientation
8383
// changed while the header was collapsed, then bail out.
8484
if (!isLandscape) {
85-
animatedHeight.set(naturalHeightValue);
85+
animatedHeight.set(withTiming(naturalHeightValue, {duration: RESTORE_DURATION}));
8686
return;
8787
}
8888

@@ -130,11 +130,13 @@ function CollapsibleHeaderOnKeyboard({children, collapsibleHeaderOffset = 0}: Co
130130
});
131131

132132
return (
133-
<Reanimated.View
134-
style={outerStyle}
135-
onLayout={onLayout}
136-
>
137-
<Reanimated.View style={innerStyle}>{children}</Reanimated.View>
133+
<Reanimated.View style={outerStyle}>
134+
<Reanimated.View
135+
onLayout={onLayout}
136+
style={innerStyle}
137+
>
138+
{children}
139+
</Reanimated.View>
138140
</Reanimated.View>
139141
);
140142
}

0 commit comments

Comments
 (0)