Merge remote-tracking branch 'origin/main' into hailey/0.76
This commit is contained in:
@@ -64,11 +64,14 @@ class SheetViewController: UIViewController {
|
|||||||
|
|
||||||
func updateDetents(contentHeight: CGFloat, preventExpansion: Bool) {
|
func updateDetents(contentHeight: CGFloat, preventExpansion: Bool) {
|
||||||
if let sheet = self.sheetPresentationController {
|
if let sheet = self.sheetPresentationController {
|
||||||
sheet.animateChanges {
|
// Capture `self` weakly to prevent retain cycles.
|
||||||
self.setDetents(contentHeight: contentHeight, preventExpansion: preventExpansion)
|
// Also, capture `sheet` weakly to avoid potential strong references held by animateChanges.
|
||||||
if #available(iOS 16.0, *) {
|
sheet.animateChanges { [weak self, weak sheet] in
|
||||||
sheet.invalidateDetents()
|
guard let weakSelf = self, let weakSheet = sheet else { return }
|
||||||
}
|
weakSelf.setDetents(contentHeight: contentHeight, preventExpansion: preventExpansion)
|
||||||
|
if #available(iOS 16.0, *) {
|
||||||
|
weakSheet.invalidateDetents()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,10 +396,14 @@ const ImageItem = ({
|
|||||||
placeholderContentFit="cover"
|
placeholderContentFit="cover"
|
||||||
placeholder={{uri: imageSrc.thumbUri}}
|
placeholder={{uri: imageSrc.thumbUri}}
|
||||||
accessibilityLabel={imageSrc.alt}
|
accessibilityLabel={imageSrc.alt}
|
||||||
onLoad={e => {
|
onLoad={
|
||||||
setHasLoaded(true)
|
hasLoaded
|
||||||
onLoad({width: e.source.width, height: e.source.height})
|
? undefined
|
||||||
}}
|
: e => {
|
||||||
|
setHasLoaded(true)
|
||||||
|
onLoad({width: e.source.width, height: e.source.height})
|
||||||
|
}
|
||||||
|
}
|
||||||
style={{flex: 1, borderRadius}}
|
style={{flex: 1, borderRadius}}
|
||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
|
|||||||
@@ -228,10 +228,14 @@ const ImageItem = ({
|
|||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
enableLiveTextInteraction={showControls && !scaled}
|
enableLiveTextInteraction={showControls && !scaled}
|
||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
onLoad={e => {
|
onLoad={
|
||||||
setHasLoaded(true)
|
hasLoaded
|
||||||
onLoad({width: e.source.width, height: e.source.height})
|
? undefined
|
||||||
}}
|
: e => {
|
||||||
|
setHasLoaded(true)
|
||||||
|
onLoad({width: e.source.width, height: e.source.height})
|
||||||
|
}
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
|||||||
@@ -113,9 +113,13 @@ export function AutoSizedImage({
|
|||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
accessibilityLabel={image.alt}
|
accessibilityLabel={image.alt}
|
||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
onLoad={e => {
|
onLoad={
|
||||||
setFetchedDims({width: e.source.width, height: e.source.height})
|
fetchedDims
|
||||||
}}
|
? undefined
|
||||||
|
: e => {
|
||||||
|
setFetchedDims({width: e.source.width, height: e.source.height})
|
||||||
|
}
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<MediaInsetBorder />
|
<MediaInsetBorder />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user