fix(ui): adjust keyboard handling and prevent duplicate view recording
- Fix keyboard avoidance logic in PostDetailScreen and ChatScreen by applying manual keyboard height offsets only on Android, preventing double padding on iOS. - Prevent multiple view recording calls in TradeDetailScreen by using a ref to track if the view has already been recorded.
This commit is contained in:
@@ -47,6 +47,8 @@ interface PostMentionInputProps {
|
||||
minHeight?: number;
|
||||
autoExpand?: boolean;
|
||||
onPostRefPasted?: (postId: string, title: string) => void;
|
||||
onSubmitEditing?: () => void;
|
||||
returnKeyType?: 'default' | 'send' | 'done';
|
||||
}
|
||||
|
||||
const PostMentionInput: React.FC<PostMentionInputProps> = ({
|
||||
@@ -59,6 +61,8 @@ const PostMentionInput: React.FC<PostMentionInputProps> = ({
|
||||
minHeight = 100,
|
||||
autoExpand = false,
|
||||
onPostRefPasted,
|
||||
onSubmitEditing,
|
||||
returnKeyType = 'default',
|
||||
}) => {
|
||||
const colors = useAppColors();
|
||||
const currentUser = useAuthStore(s => s.currentUser);
|
||||
@@ -281,6 +285,9 @@ const PostMentionInput: React.FC<PostMentionInputProps> = ({
|
||||
multiline
|
||||
textAlignVertical="top"
|
||||
scrollEnabled={!autoExpand}
|
||||
returnKeyType={returnKeyType}
|
||||
onSubmitEditing={onSubmitEditing}
|
||||
blurOnSubmit={false}
|
||||
style={[
|
||||
styles.input,
|
||||
autoExpand && styles.inputAutoExpand,
|
||||
|
||||
Reference in New Issue
Block a user