Skip to content

Commit 6e4f046

Browse files
committed
add container
1 parent 4ee47cd commit 6e4f046

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/components/ChatScreen/ChatScreen.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,12 @@
5151
}
5252
.sendButton:active {
5353
opacity: 0.6;
54+
}
55+
56+
/* Added to manage keyboard visibility */
57+
.chatScreenContainer {
58+
display: flex;
59+
flex-direction: column;
60+
flex-grow: 1; /* Allow this container to grow and fill available space */
61+
overflow: hidden; /* Prevent parent scrolling when keyboard is up */
5462
}

src/components/ChatScreen/ChatScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const ChatScreen: React.FC<ChatScreenProps> = ({ messages, sendMessage })
4040
};
4141

4242
return (
43-
<>
43+
<div className={styles.chatScreenContainer}> {/* Changed from <> to <div> and added className */}
4444
<div className={styles.messagesContainer}>
4545
{messages.map(msg => (
4646
<ChatMessage
@@ -81,6 +81,6 @@ export const ChatScreen: React.FC<ChatScreenProps> = ({ messages, sendMessage })
8181
</svg>
8282
</button>
8383
</div>
84-
</>
84+
</div> // Corresponding closing div
8585
);
8686
};

0 commit comments

Comments
 (0)