From 7708bc97c1d618ec5f4b0fdd4a6887b817dabcae Mon Sep 17 00:00:00 2001 From: yougotwill Date: Mon, 12 Aug 2024 10:43:08 +1000 Subject: [PATCH] fix: make sure to show scroll bar on fixed height session input --- ts/components/dialog/UserDetailsDialog.tsx | 11 +++++++---- ts/components/inputs/SessionInput.tsx | 7 +++++-- ts/components/leftpane/overlay/OverlayInvite.tsx | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ts/components/dialog/UserDetailsDialog.tsx b/ts/components/dialog/UserDetailsDialog.tsx index baa388e20..c4559e4a9 100644 --- a/ts/components/dialog/UserDetailsDialog.tsx +++ b/ts/components/dialog/UserDetailsDialog.tsx @@ -13,12 +13,15 @@ import { CopyToClipboardButton } from '../buttons/CopyToClipboardButton'; import { SessionInput } from '../inputs'; import { SessionWrapperModal } from '../SessionWrapperModal'; import { ConversationTypeEnum } from '../../models/types'; +import { StyledTextAreaContainer } from '../inputs/SessionInput'; const StyledInputContainer = styled(Flex)` - textarea { - cursor: default; - overflow: hidden; - top: 14px; + ${StyledTextAreaContainer} { + overflow-y: hidden; + textarea { + cursor: default; + top: 10px; + } } `; diff --git a/ts/components/inputs/SessionInput.tsx b/ts/components/inputs/SessionInput.tsx index 2f30ce0e3..a7d88775f 100644 --- a/ts/components/inputs/SessionInput.tsx +++ b/ts/components/inputs/SessionInput.tsx @@ -99,9 +99,12 @@ export const StyledTextAreaContainer = styled(motion.div)<{ }>` display: flex; align-items: center; - overflow: hidden; + overflow-y: ${props => (props.noValue ? 'hidden' : 'auto')}; position: relative; - height: ${props => (props.textSize ? `calc(var(--font-size-${props.textSize}) * 4)` : '48px')}; + min-height: 48px; + height: 100%; + max-height: ${props => + props.textSize ? `calc(var(--font-size-${props.textSize}) * 4)` : '48px'}; width: 100%; margin: var(--margins-sm) var(--margins-md); diff --git a/ts/components/leftpane/overlay/OverlayInvite.tsx b/ts/components/leftpane/overlay/OverlayInvite.tsx index d8dc90a4f..9ab6bfa05 100644 --- a/ts/components/leftpane/overlay/OverlayInvite.tsx +++ b/ts/components/leftpane/overlay/OverlayInvite.tsx @@ -56,10 +56,11 @@ const StyledButtonerContainer = styled.div` const StyledInputContainer = styled(Flex)` ${StyledTextAreaContainer} { margin: var(--margins-sm); + overflow-y: hidden; + textarea { cursor: default; - overflow: hidden; - top: 12px; + top: 10px; } } `;