Skip to content

Commit

Permalink
Fix: allow scrolling of legend on IOS
Browse files Browse the repository at this point in the history
  • Loading branch information
micrology committed Jan 6, 2025
1 parent 78f3e1c commit 72cdad8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion css/prsm.css
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,9 @@ input:checked + .slider:before {
z-index: 30;
}
.legendTitle {
font-weight: bold;
background-color: var(--header-color);
color: white;
border-radius: 4px 4px 0 0;
text-align: center;
padding: 3px;
user-select: none;
Expand Down
5 changes: 4 additions & 1 deletion js/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ export function legend(warn = false) {
physics: { enabled: false },
interaction: { zoomView: false, dragView: false },
})
let height = legendNetwork.DOMtoCanvas({ x: 0, y: 0 }).y
let height = 0
for (let i = 0; i < nodes.length; i++) {
let node = deepMerge(styles.nodes[nodes[i].groupNode])
node.id = i + 10000
Expand Down Expand Up @@ -824,6 +824,9 @@ export function legend(warn = false) {
height += 50
}
legendNetwork.fit({})
// required to allow scrolling on IOS
canvas.firstElementChild.firstElementChild.style.touchAction = 'pan-y'
canvas.firstElementChild.firstElementChild.style.webkitUserSelect = 'all'
}
window.legendData = legendData
/**
Expand Down

0 comments on commit 72cdad8

Please sign in to comment.