Skip to content

Commit fe44c4f

Browse files
authored
Update index.js to fix terminal output on mobile screen
1 parent b29a200 commit fe44c4f

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

  • src/components/InteractivePython

src/components/InteractivePython/index.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,25 @@ export default function InteractivePython({ children }) {
157157
<pre ref={outputRef} className={styles.output} />
158158
<div ref={inputContainerRef} className={styles.inputForm} style={{ display: 'none' }}>
159159
<span ref={inputPromptRef} className={styles.promptText} />
160-
<input
161-
ref={inputFieldRef}
162-
type="text"
163-
className={styles.terminalInput}
164-
onKeyDown={(e) => {
165-
if (e.key === 'Enter') {
166-
e.preventDefault();
167-
submitInput();
168-
}
169-
}}
170-
/>
160+
<form
161+
ref={inputContainerRef}
162+
className={styles.inputForm}
163+
style={{ display: 'none' }}
164+
onSubmit={(e) => {
165+
e.preventDefault();
166+
submitInput();
167+
}}
168+
>
169+
<span ref={inputPromptRef} className={styles.promptText} />
170+
<input
171+
ref={inputFieldRef}
172+
type="text"
173+
className={styles.terminalInput}
174+
/>
175+
<button type="submit" className={styles.submitInputBtn}>
176+
Enter ↵
177+
</button>
178+
</form>
171179
<button type="button" className={styles.submitInputBtn} onClick={submitInput}>
172180
Enter ↵
173181
</button>

0 commit comments

Comments
 (0)