diff --git a/modules/expo-selectable-text/ios/ExpoUITextView.swift b/modules/expo-selectable-text/ios/ExpoUITextView.swift index ebef6098a5..06a301a6ad 100644 --- a/modules/expo-selectable-text/ios/ExpoUITextView.swift +++ b/modules/expo-selectable-text/ios/ExpoUITextView.swift @@ -59,14 +59,24 @@ class ExpoUITextView: ExpoView { } } + // Just return the subviews override func reactSubviews() -> [UIView]! { return subviews } - override func didMoveToWindow() { + // Get children on update + override func didUpdateReactSubviews() { self.getTextChildren() } + // For animation issues + // See: https://github.com/facebook/react-native/blob/258d8e51b451b221e557dad4647cbd210fe37392/packages/react-native/Libraries/Text/Text/RCTTextView.mm#L66 + override func reactSetFrame(_ frame: CGRect) { + UIView.performWithoutAnimation { + super.reactSetFrame(frame) + } + } + override func layoutSubviews() { // Get the width from the bounds let maxWidth = bounds.width diff --git a/src/view/com/lightbox/Lightbox.tsx b/src/view/com/lightbox/Lightbox.tsx index 64d8bf3502..38f2c89c9b 100644 --- a/src/view/com/lightbox/Lightbox.tsx +++ b/src/view/com/lightbox/Lightbox.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {StyleSheet, View} from 'react-native' +import {LayoutAnimation, StyleSheet, View} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import ImageView from './ImageViewing' import {shareImageModal, saveImageToMediaLibrary} from 'lib/media/manip' @@ -110,7 +110,13 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) { style={[s.gray3]} numberOfLines={isAltExpanded ? undefined : 3} selectable - onPress={() => setAltExpanded(prev => !prev)}> + onPress={() => { + LayoutAnimation.configureNext({ + duration: 300, + update: {type: 'spring', springDamping: 0.7}, + }) + setAltExpanded(prev => !prev) + }}> {altText}