Workaround Safari content-visibility bug (#2699)

zio/stable
dan 2024-01-31 03:05:45 +00:00 committed by GitHub
parent 7b683b617a
commit 2b0f92c7e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -300,6 +300,9 @@ export const List = memo(React.forwardRef(ListImpl)) as <ItemT>(
props: ListProps<ItemT> & {ref?: React.Ref<ListMethods>},
) => React.ReactElement
// https://stackoverflow.com/questions/7944460/detect-safari-browser
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
const styles = StyleSheet.create({
contentContainer: {
borderLeftWidth: 1,
@ -313,7 +316,7 @@ const styles = StyleSheet.create({
},
row: {
// @ts-ignore web only
contentVisibility: 'auto',
contentVisibility: isSafari ? '' : 'auto', // Safari support for this is buggy.
},
minHeightViewport: {
// @ts-ignore web only