Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_profile: Fix channel/group tabs list container not scrollable.

Pratik Chandab726f5107e12
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index 2deefacedf0..539dc882b3c 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -770,6 +770,7 @@ export function show_user_profile(user: User, default_tab_key = "profile-tab"):
callback(_name: string | undefined, key: string) {
$(".tabcontent").hide();
$(`#${CSS.escape(key)}`).show();
+ $("#user-profile-modal").removeClass("prevent-user-modal-content-scrolling");
$("#user-profile-modal .manage-profile-tab-footer").removeClass(
"manage-profile-tab-active",
);
@@ -782,10 +783,12 @@ export function show_user_profile(user: User, default_tab_key = "profile-tab"):
break;
case "user-profile-groups-tab": {
render_or_update_user_groups_tab(user);
+ $("#user-profile-modal").addClass("prevent-user-modal-content-scrolling");
break;
}
case "user-profile-streams-tab": {
void render_or_update_user_streams_tab(user);
+ $("#user-profile-modal").addClass("prevent-user-modal-content-scrolling");
break;
}
case "manage-profile-tab":
diff --git a/web/styles/modal.css b/web/styles/modal.css
index 1cd9115608a..0a0e6a8c50d 100644
--- a/web/styles/modal.css
+++ b/web/styles/modal.css
@@ -368,6 +368,25 @@
margin-bottom: var(--user-profile-modal-body-margin-bottom);
}
+ &.prevent-user-modal-content-scrolling {
+ .modal__content {
+ flex-grow: 1;
+
+ .simplebar-content {
+ height: 100%;
+ box-sizing: border-box;
+ }
+ }
+
+ .tab-data {
+ height: calc(100% - var(--user-profile-modal-body-margin-bottom));
+ }
+
+ .tabcontent {
+ height: 100%;
+ }
+ }
+
.group-tab-element-header,
.stream-tab-element-header {
margin: 0;
@@ -379,10 +398,6 @@
#user-profile-groups-tab,
#user-profile-streams-tab {
- height: calc(
- var(--user-profile-modal-body-height) -
- var(--user-profile-modal-body-margin-bottom)
- );
display: grid;
grid-template:
"alert" auto