Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: keyboard hiding comment input on article post on app #1207

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/KeyboardAvoidingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const KeyboardAvoidingView = ({
return (
<KeyboardAvoiding
behavior={Platform.OS === "ios" ? "padding" : "height"}
style={{ flex: 1 }}
style={{ flex: 1, backgroundColor: "#000" }}
keyboardVerticalOffset={insets.top + insets.bottom + extraVerticalOffset}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useRef, useState } from "react";
import { useWindowDimensions, View } from "react-native";
import { View, useWindowDimensions, KeyboardAvoidingView } from "react-native";
import Animated, {
useAnimatedRef,
useAnimatedScrollHandler,
Expand All @@ -11,7 +11,6 @@ import CustomAppBar from "../../../components/AppBar/CustomAppBar";

import { Post } from "@/api/feed/v1/feed";
import { BrandText } from "@/components/BrandText";
import { KeyboardAvoidingView } from "@/components/KeyboardAvoidingView";
import { OptimizedImage } from "@/components/OptimizedImage";
import { ScreenContainer } from "@/components/ScreenContainer";
import { CommentsContainer } from "@/components/cards/CommentsContainer";
Expand Down Expand Up @@ -123,7 +122,11 @@ export const MiniArticlePostDetails = ({ post, refetchPost }: Props) => {
if (!metadataToUse) return null;

return (
<KeyboardAvoidingView extraVerticalOffset={-100}>
<KeyboardAvoidingView
behavior={"padding"}
style={{ flex: 1, backgroundColor: "#000" }}
keyboardVerticalOffset={30}
>
<ScreenContainer
forceNetworkId={post.networkId}
fullWidth
Expand All @@ -139,6 +142,7 @@ export const MiniArticlePostDetails = ({ post, refetchPost }: Props) => {
style={{
flexDirection: "column",
justifyContent: "space-between",
flex: 1,
}}
>
<Animated.ScrollView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { View, ViewStyle, TextInput } from "react-native";
import { View, ViewStyle, TextInput, useWindowDimensions } from "react-native";

import penSVG from "../../../../../assets/icons/pen.svg";

Expand All @@ -23,6 +23,7 @@ export const SimpleCommentInput = ({
onFocus,
style,
}: Props) => {
const { width: windowWidth } = useWindowDimensions();
return (
<CustomPressable onPress={onFocus}>
<View
Expand Down Expand Up @@ -60,6 +61,8 @@ export const SimpleCommentInput = ({
{
height: 30,
color: secondaryColor,
width: windowWidth - 150,
alignSelf: "center",
},
]}
onPressOut={onFocus}
Expand Down
Loading