Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the Android system, the bottom of the Sheet component is wrong. #2799

Closed
LiZhequ opened this issue Jul 19, 2024 · 0 comments · Fixed by #2873
Closed

In the Android system, the bottom of the Sheet component is wrong. #2799

LiZhequ opened this issue Jul 19, 2024 · 0 comments · Fixed by #2873

Comments

@LiZhequ
Copy link
Contributor

LiZhequ commented Jul 19, 2024

Current Behavior

facebook/react-native#41918
translucent system ui returns incorrect dimensions on android,it causes an incorrect maximum height calculation, making the bottom of the sheet higher than expected,

const handleAnimationViewLayout = useCallback(
(e: LayoutChangeEvent) => {
// avoid bugs where it grows forever for whatever reason
const next = Math.min(
e.nativeEvent?.layout.height,
Dimensions.get('window').height
)
if (!next) return
setFrameSize(next)
},
[keyboardIsVisible]
)
const handleMaxContentViewLayout = useCallback(
(e: LayoutChangeEvent) => {
// avoid bugs where it grows forever for whatever reason
const next = Math.min(
e.nativeEvent?.layout.height,
Dimensions.get('window').height
)
if (!next) return
setMaxContentSize(next)
},
[keyboardIsVisible]
)

Expected Behavior

The bottom of the Sheet component is correct,no extra gap.

Tamagui Version

1.102.1

Platform (Web, iOS, Android)

Android

Reproduction

import { Sheet, TamaguiProvider, View } from 'tamagui'
import tamaguiConfig from './tamagui.config'

export default function App() {
  return (
    <TamaguiProvider config={tamaguiConfig} defaultTheme="light">
      <View flex={1} bg="gray">
        <Sheet open snapPointsMode="fit">
          <Sheet.Overlay />
          <Sheet.Frame>
            <View h={100} bg={'red'}></View>
          </Sheet.Frame>
        </Sheet>
      </View>
    </TamaguiProvider>
  )
}

20240719170307



### System Info

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant