Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize the contextmenu area to the full height of the folder view #523

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/files-card-body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ export const FilesCardBody = ({
});

return (
<div id={files_parent_id} ref={folderViewRef}>
<div
id={files_parent_id}
className="files-contextmenu-area"
ref={folderViewRef}
>
{contextMenu}
{sortedFiles.length === 0 &&
<EmptyStatePanel
Expand Down
4 changes: 3 additions & 1 deletion src/files-card-body.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* Stretch the view to fill the page */
.pf-v5-c-sidebar__main,
.pf-v5-c-sidebar__content,
.pf-v5-c-sidebar__content > .pf-v5-c-card {
.pf-v5-c-sidebar__content > .pf-v5-c-card,
.files-contextmenu-area
{
block-size: 100%;
}

Expand Down
12 changes: 10 additions & 2 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down