Skip to content

Commit 85143c0

Browse files
committed
always clear on enter
1 parent a87e420 commit 85143c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/browser-repl/src/components/shell-input.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@ export class ShellInput extends Component<ShellInputProps, ShellInputState> {
109109
};
110110

111111
private onEnter = async (): Promise<void> => {
112+
const value = this.state.currentValue;
113+
// clear the value before evaluating the input because it could take a long
114+
// time
115+
this.setState({ currentValue: '' });
116+
112117
if (this.props.onInput) {
113-
const value = this.state.currentValue;
114-
// clear the value before evaluating the input because it could take a
115-
// long time
116-
this.setState({ currentValue: '' });
117118
await this.props.onInput(value);
118119
}
119120
};

0 commit comments

Comments
 (0)