fix(app): cap the height of list picker modals (#3431)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-12 20:25:28 +02:00
1 parent d1b4b82895
commit 30b32c9a35
8 files changed
+45 -16

No files matched your search

@@ -17,14 +17,25 @@
color: var(--text-secondary); color: var(--text-secondary);
} }
.selectorRoot {
height: 45rem;
}
.selectorContent { .selectorContent {
--selector-modal-content-height: clamp(20rem, 48vh, 23.75rem);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 0;
}
:global(html.mobile-layout) .selectorRoot {
height: auto;
}
:global(html.mobile-layout) .selectorContent {
--selector-modal-content-height: clamp(20rem, 48vh, 23.75rem);
height: var(--selector-modal-content-height); height: var(--selector-modal-content-height);
min-height: var(--selector-modal-content-height); min-height: var(--selector-modal-content-height);
max-height: var(--selector-modal-content-height); max-height: var(--selector-modal-content-height);
padding: 0;
} }
.listContainer { .listContainer {
@@ -45,7 +45,12 @@ export const CreateDMModal = observer((props: CreateDMModalProps) => {
} }
}, [modalLogic]); }, [modalLogic]);
return ( return (
<Modal.Root size="small" centered data-flx="channel.create-dm-modal.modal-root"> <Modal.Root
size="small"
centered
className={selectorStyles.selectorRoot}
data-flx="channel.create-dm-modal.modal-root"
>
<Modal.Header title={i18n._(SELECT_FRIENDS_DESCRIPTOR)} data-flx="channel.create-dm-modal.modal-header"> <Modal.Header title={i18n._(SELECT_FRIENDS_DESCRIPTOR)} data-flx="channel.create-dm-modal.modal-header">
{!restriction && ( {!restriction && (
<> <>
@@ -48,7 +48,12 @@ export const GiftSendToFriendModal = observer(function GiftSendToFriendModal({co
const handleCopy = useCopyLinkHandler(giftUrl, true); const handleCopy = useCopyLinkHandler(giftUrl, true);
const {sendingTo, sentTo, send: handleSendGift} = useSendLinkToRecipients(() => giftUrl); const {sendingTo, sentTo, send: handleSendGift} = useSendLinkToRecipients(() => giftUrl);
return ( return (
<Modal.Root size="small" centered data-flx="expressions.gift-send-to-friend-modal.modal-root"> <Modal.Root
size="small"
centered
className={selectorStyles.selectorRoot}
data-flx="expressions.gift-send-to-friend-modal.modal-root"
>
<Modal.Header <Modal.Header
title={i18n._(YOU_ALREADY_HAVE_LIFETIME_DESCRIPTOR, {premiumProductName: getPremiumProductName()})} title={i18n._(YOU_ALREADY_HAVE_LIFETIME_DESCRIPTOR, {premiumProductName: getPremiumProductName()})}
data-flx="expressions.gift-send-to-friend-modal.modal-header" data-flx="expressions.gift-send-to-friend-modal.modal-header"
@@ -326,7 +326,12 @@ const InviteModalContent = observer(function InviteModalContent({
return i18n._(YOUR_INVITE_LINK_EXPIRES_IN_SECONDS_DESCRIPTOR, {seconds}); return i18n._(YOUR_INVITE_LINK_EXPIRES_IN_SECONDS_DESCRIPTOR, {seconds});
}; };
return ( return (
<Modal.Root size="small" centered data-flx="invite.invite-modal.modal-root--2"> <Modal.Root
size="small"
centered
className={selectorStyles.selectorRoot}
data-flx="invite.invite-modal.modal-root--2"
>
<Modal.Header <Modal.Header
title={!showAdvanced ? title : i18n._(INVITE_LINK_SETTINGS_DESCRIPTOR)} title={!showAdvanced ? title : i18n._(INVITE_LINK_SETTINGS_DESCRIPTOR)}
data-flx="invite.invite-modal.modal-header--2" data-flx="invite.invite-modal.modal-header--2"
@@ -21,14 +21,6 @@
caret-color: var(--text-chat); caret-color: var(--text-chat);
} }
.destinationList {
display: flex;
flex-direction: column;
height: clamp(20rem, 48vh, 23.75rem);
min-height: 0;
max-height: clamp(20rem, 48vh, 23.75rem);
}
.footerSection { .footerSection {
position: relative; position: relative;
display: flex; display: flex;
@@ -361,6 +361,7 @@ export const ForwardModal = observer(
<Modal.Root <Modal.Root
size="small" size="small"
centered centered
className={selectorStyles.selectorRoot}
initialFocusRef={shouldFocusSearch ? searchInputRef : undefined} initialFocusRef={shouldFocusSearch ? searchInputRef : undefined}
data-flx="messaging.forward-modal.modal-root" data-flx="messaging.forward-modal.modal-root"
> >
@@ -388,7 +389,7 @@ export const ForwardModal = observer(
</Modal.Header> </Modal.Header>
<Modal.Content <Modal.Content
padding="none" padding="none"
className={modalStyles.destinationList} className={selectorStyles.selectorContent}
data-flx="messaging.forward-modal.modal-content" data-flx="messaging.forward-modal.modal-content"
> >
<div className={selectorStyles.listContainer} data-flx="messaging.forward-modal.div--2"> <div className={selectorStyles.listContainer} data-flx="messaging.forward-modal.div--2">
@@ -48,7 +48,12 @@ export const AddFriendsToGroupModal = observer((props: AddFriendsToGroupModalPro
? i18n._(LINK_HIDDEN_WHILE_SHARING_DESCRIPTOR) ? i18n._(LINK_HIDDEN_WHILE_SHARING_DESCRIPTOR)
: (modalLogic.inviteLink ?? ''); : (modalLogic.inviteLink ?? '');
return ( return (
<Modal.Root size="small" centered data-flx="relationship.add-friends-to-group-modal.modal-root"> <Modal.Root
size="small"
centered
className={selectorStyles.selectorRoot}
data-flx="relationship.add-friends-to-group-modal.modal-root"
>
<Modal.Header <Modal.Header
title={i18n._(SELECT_FRIENDS_DESCRIPTOR)} title={i18n._(SELECT_FRIENDS_DESCRIPTOR)}
data-flx="relationship.add-friends-to-group-modal.modal-header" data-flx="relationship.add-friends-to-group-modal.modal-header"
@@ -144,7 +144,12 @@ export const ShareThemeModal = observer(({themeCss}: {themeCss: string}) => {
send: handleSendTheme, send: handleSendTheme,
} = useSendLinkToRecipients(() => (themeUrl ? `${i18n._(CHECK_OUT_MY_CUSTOM_THEME_DESCRIPTOR)}\n${themeUrl}` : null)); } = useSendLinkToRecipients(() => (themeUrl ? `${i18n._(CHECK_OUT_MY_CUSTOM_THEME_DESCRIPTOR)}\n${themeUrl}` : null));
return ( return (
<Modal.Root size="small" centered data-flx="theme.share-theme-modal.modal-root"> <Modal.Root
size="small"
centered
className={selectorStyles.selectorRoot}
data-flx="theme.share-theme-modal.modal-root"
>
<Modal.Header title={i18n._(SHARE_YOUR_THEME_DESCRIPTOR)} data-flx="theme.share-theme-modal.modal-header"> <Modal.Header title={i18n._(SHARE_YOUR_THEME_DESCRIPTOR)} data-flx="theme.share-theme-modal.modal-header">
<div className={selectorStyles.headerSearch} data-flx="theme.share-theme-modal.div"> <div className={selectorStyles.headerSearch} data-flx="theme.share-theme-modal.div">
<Input <Input