Skip to content

Commit 46f3e4a

Browse files
fix(ui): fix scrolling and consistent header height on small displays
- Fix scrolling in edit-menu, settings-menu, classes-menu, update-menu, custom-menu * Change .main-content from overflow:hidden to overflow-y:auto * Add flex:1 1 auto and overflow-y:auto to .menu-element-container * Add flex properties to .result-list for proper scrolling - Fix custom-menu button positioning * Update createMenuElement to detect container elements (nav/section) * Use appendChild for containers instead of insertBefore * Remove placeholder workaround in createDynamicMenu - Fix inconsistent header height across menus * Set min-height: 100px for all headers (was 50px) * Ensure mobile breakpoint also uses min-height: 100px All menus now have consistent header height and proper scrolling on small displays.
1 parent 0ba3598 commit 46f3e4a

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

remote.css

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ body {
6767
margin-inline: auto;
6868
width: 90%;
6969
max-width: 85%;
70-
min-height: 50px;
70+
min-height: 100px;
7171
display: flex;
7272
align-items: center;
7373
justify-content: space-between;
@@ -160,6 +160,7 @@ body {
160160
max-width: 95%;
161161
font-size: 1.3em;
162162
padding: 0.8em 0;
163+
min-height: 100px;
163164
gap: 0.3em;
164165
}
165166

@@ -216,7 +217,8 @@ a {
216217
display: flex;
217218
flex-direction: column;
218219
min-height: 0;
219-
overflow: hidden;
220+
overflow-y: auto;
221+
overflow-x: hidden;
220222
}
221223

222224
.menu-content {
@@ -268,6 +270,10 @@ a {
268270
width: 95%;
269271
max-width: 900px;
270272
margin-inline: auto;
273+
flex: 1 1 auto;
274+
display: flex;
275+
flex-direction: column;
276+
min-height: 0;
271277
}
272278

273279
.results:last-child {
@@ -303,10 +309,11 @@ a {
303309
.menu-element-container {
304310
display: flex;
305311
flex-direction: column;
306-
flex: 0 0 auto;
312+
flex: 1 1 auto;
307313
width: 100%;
308314
max-width: 1400px;
309315
margin-inline: auto;
316+
overflow-y: auto;
310317
}
311318

312319
.one-line {

remote.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,16 @@ const Remote = {
20752075
item.classList.add("hidden");
20762076
}
20772077

2078-
insertAfter.parentNode.insertBefore(item, insertAfter.nextSibling);
2078+
/*
2079+
* Insert element: if insertAfter is a container (nav/section), append to it
2080+
* Otherwise insert after the specified element
2081+
*/
2082+
if (insertAfter.tagName === "NAV" || insertAfter.tagName === "SECTION" ||
2083+
insertAfter.classList.contains("menu-element-container")) {
2084+
insertAfter.append(item);
2085+
} else {
2086+
insertAfter.parentNode.insertBefore(item, insertAfter.nextSibling);
2087+
}
20792088

20802089
if ("items" in content) {
20812090
for (const index of content.items) {
@@ -2120,7 +2129,7 @@ const Remote = {
21202129

21212130
// Create menu items inside the new nav
21222131
for (const item of content.items) {
2123-
this.createMenuElement(item, content.id, nav.lastChild || nav);
2132+
this.createMenuElement(item, content.id, nav);
21242133
}
21252134
}
21262135
}

0 commit comments

Comments
 (0)