Skip to content

Commit 79280f1

Browse files
Merge pull request #184 from SwiftFiddle/fix-height
Fix popover overflow handling
2 parents 51c5330 + b1a556f commit 79280f1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Public/css/popover.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
.popover-content {
88
margin: 0 0 0 0;
9-
padding: 8px 8px;
109
min-width: 400px;
1110
max-width: 40vw;
1211
background-clip: padding-box;
@@ -17,7 +16,8 @@
1716
}
1817

1918
.popover-content .title {
20-
margin: 0 8px 8px 8px;
19+
margin: 0 8px 0 8px;
20+
padding-top: 8px;
2121
font-weight: bolder;
2222
font-size: larger;
2323
}
@@ -31,6 +31,7 @@
3131
.popover-content dl {
3232
margin-top: 0;
3333
margin-bottom: 0;
34+
padding: 8px;
3435
max-height: 60vh;
3536
font-family: Menlo, Consolas, "DejaVu Sans Mono", "Ubuntu Mono", monospace;
3637
overflow: scroll;

Public/js/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ export class App {
206206
this.treeViewContainer.innerHTML = "";
207207
this.treeView = new TreeView(this.treeViewContainer, structureData);
208208

209-
const tabContainerRect = document
210-
.querySelector(".tab-content")
211-
.getBoundingClientRect();
212-
213209
let mouseoverCancel = undefined;
214210
this.treeView.onmouseover = (event, target, data) => {
215211
this.editor.selection.setRange(
@@ -370,6 +366,10 @@ export class App {
370366
this.popover.content = container.innerHTML;
371367
}
372368

369+
const tabContainerRect = document
370+
.querySelector(".tab-content")
371+
.getBoundingClientRect();
372+
373373
const parent = target.parentElement;
374374
const caret = parent.querySelector(":scope > div > .caret");
375375
this.popover.show(caret || target, {

0 commit comments

Comments
 (0)