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 the bug that AceEditor in REPL tab is not notified during resize #262

Merged
Merged
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
4 changes: 3 additions & 1 deletion src/tabs/Repl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class ProgrammableReplGUI extends React.Component<Props, State> {
public replInstance : ProgrammableRepl;
private editorAreaRect;
private editorInstance;
constructor(data: Props) {
super(data);
this.replInstance = data.programmableReplInstance;
Expand All @@ -50,6 +51,7 @@
const height = Math.max(e.clientY - this.editorAreaRect.top - BOX_PADDING_VALUE * 2, MINIMUM_EDITOR_HEIGHT);
this.replInstance.editorHeight = height;
this.setState({ editorHeight: height });
this.editorInstance.resize();
}
};
private onMouseUp = (_e) => {
Expand Down Expand Up @@ -108,7 +110,7 @@
border: '2px solid #6f8194',
}}>
<AceEditor
ref={ (e) => this.replInstance.setEditorInstance(e?.editor)}
ref={ (e) => { this.editorInstance = e?.editor; this.replInstance.setEditorInstance(e?.editor); }}

Check warning on line 113 in src/tabs/Repl/index.tsx

View workflow job for this annotation

GitHub Actions / Verify all tests pass and build success

This line has 2 statements. Maximum allowed is 1
style= { {
width: '100%',
height: `${editorHeight}px`,
Expand Down
Loading