Skip to content

Commit

Permalink
Allow panel to be scrolled again
Browse files Browse the repository at this point in the history
This is a quick fix for a major bug: the object list is currently not
scrollable.

Closes #586

Re-introduce `overflow-y: auto` so panel can be scrolled when there are
many objects.
  • Loading branch information
nikolas committed May 18, 2023
1 parent cd98d09 commit cfd2a67
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions media/src/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
const onResizePanel = function(e) {
if (isPanelResizing) {
const newWidth = e.clientX - 10;
const newWidth = e.clientX - 16;
if (newWidth >= 300 && newWidth <= window.innerWidth * 0.6) {
panelWidth = newWidth;
}
Expand Down Expand Up @@ -299,18 +299,7 @@
}
}
// Observe panel width to place panel-buttons properly.
// Annoying-ish solution, but it works.
const resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) {
if (entry && entry.contentRect && entry.contentRect.width) {
panelWidth = entry.contentRect.width;
}
}
});
const panelEl = document.querySelector('.demos-panel');
resizeObserver.observe(panelEl);
panelEl = document.querySelector('.demos-panel');
window.addEventListener('pointermove', onResizePanel);
window.addEventListener('pointerup', onResizePanelEnd);
Expand Down Expand Up @@ -776,22 +765,21 @@
.demos-panel {
z-index: 1;
position: fixed;
min-width: 300px;
max-width: 60%;
background-color: transparent;
resize: horizontal;
overflow-y: auto;
overflow-x: hidden;
}
.panel-button {
cursor: pointer;
position: absolute;
min-width: 25px;
height: 40px;
min-width: 28px;
height: 38px;
z-index: 2;
}
Expand All @@ -810,7 +798,7 @@
}
.panel-button.panel-resizer {
top: 86px;
top: 82px;
cursor: col-resize;
}
Expand Down

0 comments on commit cfd2a67

Please sign in to comment.