Skip to content

Commit

Permalink
fix weird scrolling issue (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat authored Sep 24, 2023
1 parent 432cce3 commit 3577219
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/banchan_web/components/form/combo_box/combo_box.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,15 @@ export class ComboBoxElement extends LitElement {
}

_setOpen(open: boolean) {
if (open && !isScrolledIntoView(this, document.querySelector("body"))) {
if (open) {
this.updateComplete.then(() => {
this.scrollIntoView();
if (!isScrolledIntoView(this, document.querySelector("body"))) {
this.scrollIntoView({
behavior: "smooth",
block: "center",
inline: "nearest",
});
}
});
}
this.open = open;
Expand Down
3 changes: 2 additions & 1 deletion lib/banchan_web/components/layouts/root.sface
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,15 @@
{/if}
<style>
body {
min-height: 100vh;
min-height: -webkit-fill-available;
}
html {
min-height: -webkit-fill-available;
}
</style>
</head>
<body class="h-screen overflow-hidden bg-base-200">
<body class="bg-base-200">
{@inner_content}
</body>
</html>

0 comments on commit 3577219

Please sign in to comment.