From 2b0f92c7e05f86e7f4c8588e2e6ddf61369b8d6c Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 31 Jan 2024 03:05:45 +0000 Subject: Workaround Safari content-visibility bug (#2699) --- src/view/com/util/List.web.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/view/com/util/List.web.tsx b/src/view/com/util/List.web.tsx index 3e81a8c37..29bad2db8 100644 --- a/src/view/com/util/List.web.tsx +++ b/src/view/com/util/List.web.tsx @@ -300,6 +300,9 @@ export const List = memo(React.forwardRef(ListImpl)) as ( props: ListProps & {ref?: React.Ref}, ) => 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 -- cgit 1.4.1