mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-31 11:08:26 +01:00
fix(dropdown): make all stacked dropdowns visible in download sheet
@expo/ui's <Host> (SDK 55) fills its parent and reports its own size via setStyleSize, so it can't size to content. With the Host's flex:1 height depending on a zero-size wrapper, a circular dependency collapsed every selector nested more than one level deep — only the first (Quality) stayed visible in the download sheet. Pin the wrapper View to the measured trigger size and let the Host fill it via absoluteFill, breaking the cycle so Video/Audio/Subtitle render too.
This commit is contained in:
@@ -262,24 +262,28 @@ const PlatformDropdownComponent = ({
|
|||||||
}, [isVisible, controlledOpen, controlledOnOpenChange]);
|
}, [isVisible, controlledOpen, controlledOnOpenChange]);
|
||||||
|
|
||||||
if (Platform.OS === "ios") {
|
if (Platform.OS === "ios") {
|
||||||
|
// Pin the wrapper to the measured trigger size. @expo/ui's <Host> (SDK 55)
|
||||||
|
// fills its parent and reports its own size via setStyleSize, so it can't
|
||||||
|
// size itself to content. If the wrapper has no size, the Host's `flex: 1`
|
||||||
|
// height depends on the parent while the parent depends on the Host — a
|
||||||
|
// circular dependency that collapses to 0 for any selector nested more than
|
||||||
|
// one level deep (so only the first, shallowest dropdown stays visible).
|
||||||
|
// Giving the wrapper the measured size breaks the cycle; the Host then
|
||||||
|
// fills a concrete box.
|
||||||
return (
|
return (
|
||||||
<View>
|
<View style={triggerSize ?? { opacity: 0 }}>
|
||||||
{/* Hidden measurer: lays the trigger out normally to capture its
|
{/* Hidden measurer: lays the trigger out off-flow to capture its
|
||||||
intrinsic size, which we then pin onto the Host below. */}
|
intrinsic size. Absolutely positioned WITHOUT right/bottom so it
|
||||||
<View style={StyleSheet.absoluteFill} pointerEvents='none' aria-hidden>
|
sizes to the trigger's content rather than to its parent. */}
|
||||||
<View
|
<View
|
||||||
style={{ alignSelf: "flex-start" }}
|
style={{ position: "absolute", top: 0, left: 0, opacity: 0 }}
|
||||||
onLayout={handleMeasureTrigger}
|
pointerEvents='none'
|
||||||
>
|
aria-hidden
|
||||||
{trigger}
|
onLayout={handleMeasureTrigger}
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<Host
|
|
||||||
style={[
|
|
||||||
triggerSize ?? { opacity: 0 },
|
|
||||||
expoUIConfig?.hostStyle as any,
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
|
{trigger}
|
||||||
|
</View>
|
||||||
|
<Host style={[StyleSheet.absoluteFill, expoUIConfig?.hostStyle as any]}>
|
||||||
<Menu label={trigger}>
|
<Menu label={trigger}>
|
||||||
{groups.flatMap((group, groupIndex) => {
|
{groups.flatMap((group, groupIndex) => {
|
||||||
// Check if this group has radio options
|
// Check if this group has radio options
|
||||||
|
|||||||
Reference in New Issue
Block a user