Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Make mobile adjusments to the datepicker: Avoid overflows and adjust some spacings

Henriette Dargebf105f2501d2
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.html b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
index d29f6a3d375..2557fdeaea1 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.html
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
@@ -26,7 +26,7 @@
<div class="op-datepicker-modal--dates-container">
<ng-container *ngIf="singleDate">
- <div class="form--field">
+ <div class="form--field op-datepicker-modal--date-form">
<label class="form--label"
[textContent]="text.date">
</label>
@@ -52,7 +52,7 @@
</ng-container>
<ng-container *ngIf="!singleDate">
- <div class="form--field"
+ <div class="form--field op-datepicker-modal--date-form"
data-qa-selector="datepicker-start-date"
>
<label class="form--label"
@@ -80,7 +80,7 @@
</a>
</div>
</div>
- <div class="form--field"
+ <div class="form--field op-datepicker-modal--date-form"
data-qa-selector="datepicker-end-date"
>
<label class="form--label"
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.sass b/frontend/src/app/shared/components/datepicker/datepicker.modal.sass
index 4a981b9576a..7b9152a89d9 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.sass
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.sass
@@ -4,6 +4,7 @@
z-index: 500
width: auto
// Basically the width of the two calendars next to each other + spacings
+ // will be overwritten on mobile
max-width: 600px
min-height: 200px
box-shadow: $spot-shadow-light-mid
diff --git a/frontend/src/app/shared/components/datepicker/datepicker_mobile.modal.sass b/frontend/src/app/shared/components/datepicker/datepicker_mobile.modal.sass
index e8ff91d05df..0492923f95e 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker_mobile.modal.sass
+++ b/frontend/src/app/shared/components/datepicker/datepicker_mobile.modal.sass
@@ -1,6 +1,10 @@
@media screen and (max-width: 679px)
.op-datepicker-modal
height: initial
- width: calc(100vw - 2rem)
+ max-width: 300px
&--dates-container
- grid-template-columns: 1fr max-content
+ grid-template-columns: 1fr 1fr
+
+ &--date-form
+ &:only-child
+ grid-column: 1 / 3
diff --git a/frontend/src/global_styles/content/_datepicker.sass b/frontend/src/global_styles/content/_datepicker.sass
index 76877c4acb5..73e058d514d 100644
--- a/frontend/src/global_styles/content/_datepicker.sass
+++ b/frontend/src/global_styles/content/_datepicker.sass
@@ -63,6 +63,8 @@ $datepicker--border-radius: 5px
padding: 0 1rem 0 0
&:last-of-type
padding: 0 0 0 1rem
+ &:only-of-type
+ padding: 0
.flatpickr-prev-month
padding-left: 0
@@ -73,6 +75,11 @@ $datepicker--border-radius: 5px
.dayContainer
box-shadow: none
min-width: 283px
+ max-width: 283px
+
+ @media screen and (max-width: 679px)
+ min-width: 267px
+ max-width: 267px
.flatpickr-day
color: $spot-color-basic-black