fix(FN-1606): constrain task detail dropdown menus to viewport on mobile
- Add mobile CSS rules for .detail-actions-menu and .detail-move-menu dropdowns - Position dropdowns above action bar with bottom: calc(100% + 4px) - Constrain max-height to calc(100dvh - 120px) for viewport fit - Enable overflow scrolling with -webkit-overflow-scrolling: touch - Fix test assertion to match multi-selector CSS format
This commit is contained in:
@@ -101,4 +101,23 @@ describe("core modals mobile css coverage", () => {
|
||||
expect(mobileBlock).toContain(".gm-nav-item {");
|
||||
expect(mobileBlock).toContain("min-height: 36px;");
|
||||
});
|
||||
|
||||
it("TaskDetailModal: action dropdown menus have max-height constraint on mobile", () => {
|
||||
const css = fs.readFileSync(stylesPath, "utf-8");
|
||||
const mobileBlock = getMainMobileBlock(css);
|
||||
|
||||
// Verify dropdown menu selectors are in mobile block (selectors share the same line)
|
||||
expect(mobileBlock).toContain(".detail-actions-menu,");
|
||||
expect(mobileBlock).toContain(".detail-move-menu {");
|
||||
|
||||
// Extract the dropdown menu rule block and verify constraints
|
||||
const menuBlockMatch = mobileBlock.match(
|
||||
/\.detail-actions-menu,\s*\.detail-move-menu\s*\{[^}]+\}/s,
|
||||
);
|
||||
expect(menuBlockMatch).not.toBeNull();
|
||||
const menuBlock = menuBlockMatch![0];
|
||||
|
||||
expect(menuBlock).toContain("max-height");
|
||||
expect(menuBlock).toContain("overflow-y: auto");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6560,10 +6560,13 @@ body {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* Mobile dropdown menus — position above action bar */
|
||||
/* Mobile dropdown menus — position above action bar, constrained to viewport */
|
||||
.detail-actions-menu,
|
||||
.detail-move-menu {
|
||||
bottom: calc(100% + 4px);
|
||||
max-height: calc(100dvh - 120px);
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
|
||||
Reference in New Issue
Block a user