Skip to content

Commit

Permalink
Fix initial editor value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJunny committed Dec 5, 2024
1 parent 86bf22a commit 4dd1e71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/_components/challenges/challenge-content-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ export default function ChallengeContentInfo({
</HoverCardContent>
</HoverCard>
</Label>
<pre className="text-wrap bg-background-variant font-mono">
<pre className="word-break whitespace-pre-line break-words bg-background-variant font-mono">
{challengeData?.challenge_example_input}
</pre>
<Label>Output</Label>
<pre className="text-wrap bg-background-variant font-mono">
<pre className="word-break whitespace-pre-line break-words bg-background-variant font-mono">
{challengeData?.challenge_example_output}
</pre>
<Label>Explanation</Label>
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/challenges/challenge-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function ChallengeContentPage({
/>
</ScrollArea>
</ResizablePanel>
<ResizableHandle withHandle={windowWidth <= 768} />
<ResizableHandle />
<ResizablePanel defaultSize={50} minSize={20}>
<ResizablePanelGroup direction="vertical">
<ResizablePanel defaultSize={65} minSize={10}>
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/challenges/challenge-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function ChallengeEditorWrapper({
}, [header, submission, setLanguage, language]);

useEffect(() => {
setValue(value);
if (value.length > 0) setValue(value);
}, []);

return (
Expand Down

0 comments on commit 4dd1e71

Please sign in to comment.