Skip to content

Commit 04d15a7

Browse files
committed
feat(web-host): Prevent bouncing effect when scrolling on the REPL page (multiple scrolling containers)
1 parent 391961f commit 04d15a7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/web-host/src/components/ReplPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const ReplPage = ({ onBackToHome }: ReplPageProps) => {
99
const wasm = useWasm();
1010

1111
return (
12-
<div className="container mx-auto px-4 max-w-4xl">
12+
<div className="container mx-auto px-4 max-w-4xl" data-page="repl">
1313
<div className="sticky top-0 py-2 bg-gray-50">
1414
<div className="flex items-center justify-between md:mb-10 my-2">
1515
<h2 className="text-lg font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-[var(--color-wasi-purple)] to-[var(--color-wasi-violet)] drop-shadow">

packages/web-host/src/index.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ body {
4343
color: #222;
4444
}
4545

46+
/* Prevent bouncing effect when scrolling on the REPL page (multiple scrolling containers) */
47+
body:has([data-page="repl"]) {
48+
overflow: hidden;
49+
position: fixed;
50+
top: 0;
51+
left: 0;
52+
width: 100%;
53+
}
54+
4655
/* Focus styles for better accessibility */
4756
button:focus-visible {
4857
outline: 2px solid var(--color-primary);

0 commit comments

Comments
 (0)