Skip to content

Commit aa10a23

Browse files
authored
Merge pull request #1724 from adobe/ens83070/FORMS-18632
FORMS-18632: Info or functionality is unavailable at 320px width equivalent @sunnym @vavarshn
2 parents 84d1c47 + ff3bd0a commit aa10a23

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/datepicker/v1/datepicker/clientlibs/site/css/datepickerwidget.css

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
outline: solid #CCCCCC 2px;
2525
flex-direction: column;
2626
width: 433px;
27+
max-width: calc(100vw - 20px);
28+
box-sizing: border-box;
2729
}
2830

2931
.datetimepicker .dp-clear {
@@ -112,7 +114,8 @@
112114
box-sizing: border-box;
113115
-moz-box-sizing: border-box;
114116
color: #666666;
115-
min-width:40px;
117+
min-width: 40px;
118+
flex: 0 0 calc(100% / 7);
116119
}
117120

118121
.datetimepicker .view ul.header li {
@@ -165,4 +168,39 @@
165168

166169
.datefieldwidget.widgetreadonly .cmp-adaptiveform-datepicker__calendar-icon {
167170
display: none;
171+
}
172+
173+
/* Responsive styles for WCAG 1.4.10 Reflow compliance at 320px */
174+
@media (max-width: 400px) {
175+
.datetimepicker {
176+
width: calc(100vw - 20px);
177+
left: 10px !important;
178+
right: 10px !important;
179+
}
180+
181+
.datetimepicker .view ul {
182+
padding: 2px;
183+
}
184+
185+
.datetimepicker .view ul li {
186+
min-width: 30px;
187+
padding: 3px 1px;
188+
font-size: 0.75rem;
189+
flex: 0 0 calc(100% / 7);
190+
}
191+
192+
.datetimepicker .dp-header .dp-caption {
193+
flex: 1;
194+
font-size: 0.875rem;
195+
overflow: hidden;
196+
text-overflow: ellipsis;
197+
white-space: nowrap;
198+
}
199+
200+
.datetimepicker .dp-header .dp-leftnav,
201+
.datetimepicker .dp-header .dp-rightnav {
202+
min-width: 35px;
203+
width: 35px;
204+
flex-shrink: 0;
205+
}
168206
}

ui.tests/test-module/specs/datepicker/datepicker.runtime.layout.cy.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,22 @@ describe("Form Runtime layout of Date Picker ", () => {
361361
});
362362
});
363363

364+
it("should display navigation controls at 320px viewport", () => {
365+
cy.viewport(320, 568);
366+
const [datePicker] = Object.entries(formContainer._fields)[0];
367+
368+
cy.get(`#${datePicker}`).find(".cmp-adaptiveform-datepicker__calendar-icon").click();
369+
cy.get(".dp-leftnav").should("be.visible");
370+
cy.get(".dp-rightnav").should("be.visible");
371+
});
372+
373+
it("should display first column dates at 320px", () => {
374+
cy.viewport(320, 568);
375+
const [datePicker] = Object.entries(formContainer._fields)[0];
376+
377+
cy.get(`#${datePicker}`).find("input").clear().type('2026-02-01');
378+
cy.get(`#${datePicker}`).find(".cmp-adaptiveform-datepicker__calendar-icon").click();
379+
cy.get("#li-day-2").should("be.visible");
380+
});
381+
364382
})

0 commit comments

Comments
 (0)