From 694fbd3ca8bcd2c7eb56c86b2aa6a4007207fdad Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Thu, 6 Jun 2024 12:07:52 +0200 Subject: [PATCH] Resize the contextmenu area to the full height of the folder view This bug was introduced by 45aa7686f82d5b8f7ea2e which makes the content area stretch except the contextmenu div which this PR fixes and adds a test that right clicking in the middle of the div works. --- src/files-card-body.jsx | 6 +++++- src/files-card-body.scss | 4 +++- test/check-application | 12 ++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/files-card-body.jsx b/src/files-card-body.jsx index 9c48abe6..751ebfba 100644 --- a/src/files-card-body.jsx +++ b/src/files-card-body.jsx @@ -363,7 +363,11 @@ export const FilesCardBody = ({ }); return ( -
+
{contextMenu} {sortedFiles.length === 0 && .pf-v5-c-card { +.pf-v5-c-sidebar__content > .pf-v5-c-card, +.files-contextmenu-area +{ block-size: 100%; } diff --git a/test/check-application b/test/check-application index 91e263b6..3390fe83 100755 --- a/test/check-application +++ b/test/check-application @@ -591,8 +591,16 @@ class TestFiles(testlib.MachineCase): self.enter_files() b.allow_download() - # Create folder from context menu - b.mouse("#files-card-parent", "contextmenu") + # We should be able to click anywhere in this div. + body_size = b.eval_js(""" + [ + document.getElementById('files-card-parent').offsetWidth, + document.getElementById('files-card-parent').offsetHeight + ] + """) + + # Create folder from context menu, click in the middle to assert we can click everywhere. + b.mouse("#files-card-parent", "contextmenu", body_size[0] / 2, body_size[0] / 2) b.click(".contextMenu button:contains('Create directory')") b.set_input_text("#create-directory-input", "newdir") b.click("button.pf-m-primary")