Skip to content

Commit 9ab30ef

Browse files
authored
Merge pull request dimagi#917 from dimagi/sr/modalscroll
allow scrolling on modal when it doesn't fit on screen
2 parents 23c8995 + 5ac5040 commit 9ab30ef

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

commcare_connect/program/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self, *args, **kwargs):
6666
**{"@click": "showProgramAddModal = showProgramEditModal = false"},
6767
),
6868
Submit("submit", "Submit", css_class="button button-md primary-dark"),
69-
css_class="float-end",
69+
css_class="flex gap-3 justify-end mt-4",
7070
),
7171
)
7272

commcare_connect/templates/components/organization_home_page/add_org_member_modal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<div x-show="showAddMemberModal"
55
x-cloak
66
x-transition.opacity
7-
class="fixed inset-0 z-50 flex items-center justify-center modal-backdrop"
7+
class="modal-backdrop"
88
@keydown.escape.window="showAddMemberModal = false">
99
<div @click.outside="showAddMemberModal = false"
10-
class="bg-white rounded-2xl shadow-xl w-full max-w-lg p-6">
10+
class="modal">
1111

1212
<div class="flex justify-between items-center pb-2 mb-4">
1313
<h2 class="text-lg font-semibold text-brand-deep-purple">

commcare_connect/templates/components/organization_home_page/remove_org_member_confirm_modal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% load i18n %}
22

33
<div x-show="showConfirmRemoveMembershipModal" x-cloak x-transition.opacity
4-
class="fixed inset-0 z-50 flex items-center justify-center modal-backdrop"
4+
class="modal-backdrop"
55
@keydown.escape.window="showConfirmRemoveMembershipModal = false">
6-
<div @click.outside="showConfirmRemoveMembershipModal = false" class="bg-white rounded-2xl shadow-xl w-full max-w-lg p-6">
6+
<div @click.outside="showConfirmRemoveMembershipModal = false" class="modal">
77

88
<div class="flex justify-between items-center pb-2 mb-4">
99
<h2 class="text-lg font-medium text-brand-deep-purple">

commcare_connect/templates/components/worker_page/delete_invites_confirm_modal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% load i18n %}
22

33
<div x-show="{{ modal_name }}" x-cloak x-transition.opacity
4-
class="fixed inset-0 z-50 flex items-center justify-center modal-backdrop"
4+
class="modal-backdrop"
55
@keydown.escape.window="{{ modal_name }} = false">
6-
<div @click.outside="{{ modal_name }} = false" class="bg-white rounded-2xl shadow-xl w-full max-w-lg p-6">
6+
<div @click.outside="{{ modal_name }} = false" class="modal">
77

88
<div class="flex justify-between items-center pb-2 mb-4">
99
<h2 class="text-lg font-medium text-brand-deep-purple">

commcare_connect/templates/components/worker_page/export_modal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<div x-show="{{ modal_name }}"
44
x-cloak
55
x-transition.opacity
6-
class="fixed inset-0 z-50 flex items-center justify-center modal-backdrop"
6+
class="modal-backdrop"
77
@keydown.escape.window="{{ modal_name }} = false">
88
<div @click.outside="{{ modal_name }} = false"
9-
class="bg-white rounded-2xl shadow-xl w-full max-w-lg p-6">
9+
class="modal">
1010

1111
<div class="flex justify-between items-center pb-2 mb-4">
1212
<h2 class="text-lg font-medium text-brand-deep-purple">

commcare_connect/templates/components/worker_page/import_modal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<div x-show="{{ modal_name }}"
44
x-cloak
55
x-transition.opacity
6-
class="fixed inset-0 z-50 flex items-center justify-center modal-backdrop"
6+
class="modal-backdrop"
77
@keydown.escape.window="{{ modal_name }} = false">
88
<div @click.outside="{{ modal_name }} = false"
9-
class="bg-white rounded-2xl shadow-xl w-full max-w-lg p-6">
9+
class="modal">
1010

1111
<div class="flex justify-between items-center pb-2 mb-4">
1212
<h2 class="text-lg font-medium text-brand-deep-purple">

tailwind/tailwind.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,11 @@
674674

675675
@layer {
676676
.modal {
677-
@apply relative z-50 w-full max-w-lg rounded-xl bg-white p-6 shadow-xl;
677+
@apply relative z-50 mx-auto my-4 w-full max-w-lg rounded-xl bg-white p-6 shadow-xl;
678678
}
679679

680680
.modal-backdrop {
681-
@apply fixed inset-0 z-40 flex items-center justify-center bg-black/40;
681+
@apply fixed inset-0 z-40 overflow-y-auto bg-black/40 p-4;
682682
}
683683

684684
.modal .dialog-box {

0 commit comments

Comments
 (0)