Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: investigating scroll issue #1094

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 12 additions & 34 deletions sandpack-react/src/Playground.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as themes from "@codesandbox/sandpack-themes";
import React from "react";

import { Sandpack } from "./";
Expand All @@ -9,37 +8,16 @@ export default {
};

export const Basic: React.FC = () => {
return <Sandpack template="react" theme={themes.sandpackDark} />;
return (
<>
{new Array(10).fill(null).map((_, index) => (
<Sandpack
options={{
initMode: "user-visible",
}}
template="static"
/>
))}
</>
);
};

export const EslintBasic = () => (
<Sandpack
files={{
"/.eslintrc.js": `module.exports = {
rules: {
"no-unused-vars": "error",
"no-console": "error",
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
}`,
"/index.js": `const helloWorld = "";

console.log("foo");`,

"/package.json": JSON.stringify({
devDependencies: {
eslint: "^8.0.1",
},
scripts: { start: "eslint index.js" },
}),
}}
options={{
visibleFiles: ["/index.js", "/.eslintrc.js"],
showConsole: true,
}}
template="node"
/>
);
4 changes: 2 additions & 2 deletions sandpack-react/src/contexts/utils/useClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ export const useClient: UseClient = (
client.iframe.contentWindow?.location.replace("about:blank");
client.iframe.removeAttribute("src");
delete clients.current[clientId];
} else {
delete registeredIframes.current[clientId];
}

delete registeredIframes.current[clientId];

if (timeoutHook.current) {
clearTimeout(timeoutHook.current);
}
Expand Down
Loading