diff options
author | dan <dan.abramov@gmail.com> | 2023-10-13 15:25:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 15:25:16 +0100 |
commit | eba9f8a1662e78ff79b7d179efa8dec261d61d87 (patch) | |
tree | 093be93d90768e06e8eca3c251abc527b19ce968 /src | |
parent | 2a1edab6d4a8e8b4197b10868153a525f918509c (diff) | |
download | voidsky-eba9f8a1662e78ff79b7d179efa8dec261d61d87.tar.zst |
Fix profile layout shift (#1690)
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/util/ViewSelector.tsx | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/view/com/util/ViewSelector.tsx b/src/view/com/util/ViewSelector.tsx index 6c0e4c6cc..935d93033 100644 --- a/src/view/com/util/ViewSelector.tsx +++ b/src/view/com/util/ViewSelector.tsx @@ -144,8 +144,6 @@ export function Selector({ items: string[] onSelect?: (index: number) => void }) { - const [height, setHeight] = useState(0) - const pal = usePalette('default') const borderColor = useColorSchemeStyle( {borderColor: colors.black}, @@ -160,22 +158,13 @@ export function Selector({ <View style={{ width: '100%', - position: 'relative', - overflow: 'hidden', - height, backgroundColor: pal.colors.background, }}> <ScrollView testID="selector" horizontal - showsHorizontalScrollIndicator={false} - style={{position: 'absolute'}}> - <View - style={[pal.view, styles.outer]} - onLayout={e => { - const {height: layoutHeight} = e.nativeEvent.layout - setHeight(layoutHeight || 60) - }}> + showsHorizontalScrollIndicator={false}> + <View style={[pal.view, styles.outer]}> {items.map((item, i) => { const selected = i === selectedIndex return ( |