Skip to content

Commit

Permalink
Fix #5912: Resource Manger Context Menu Doesn't reposition after scroll.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyhfish authored and bdukes committed Jan 15, 2024
1 parent 5df0e9d commit 761ea63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
:host {
display: block;
margin-left: 1em;
position: relative;
}

button{
Expand All @@ -12,7 +13,7 @@ button{
}

dnn-collapsible{
position: fixed;
position: absolute;
display: none;
border: 1px solid lightgray;
box-shadow: 2px 2px 4px -2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,17 @@ export class DnnRmFolderList {

private handleContextMenu(e: MouseEvent): void {
e.preventDefault();
this.dismissContextMenu();

this.itemsClient.getFolderItem(state.settings.HomeFolderId)
.then(item => {
const collapsible = document.createElement("dnn-collapsible");
const folderContextMenu = document.createElement("dnn-rm-folder-context-menu");
collapsible.appendChild(folderContextMenu);
folderContextMenu.item = item;
collapsible.style.left = `${e.pageX}px`;
collapsible.style.top = `${e.pageY}px`;
const parentPosition = this.el.getBoundingClientRect();
collapsible.style.left = `${e.clientX - parentPosition.left}px`;
collapsible.style.top = `${e.clientY - parentPosition.top}px`;
collapsible.style.display = "block";
this.el.shadowRoot.appendChild(collapsible);
setTimeout(() => {
Expand Down

0 comments on commit 761ea63

Please sign in to comment.