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

Properly set the value of the select component in DebugBreakpointWidget #12567

Merged
merged 1 commit into from
Jul 26, 2023
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
7 changes: 7 additions & 0 deletions packages/debug/src/browser/editor/debug-breakpoint-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export class DebugBreakpointWidget implements Disposable {
}
}

private readonly selectComponentRef = React.createRef<SelectComponent>();

@postConstruct()
protected init(): void {
this.doInit();
Expand Down Expand Up @@ -219,13 +221,18 @@ export class DebugBreakpointWidget implements Disposable {
if (this._input) {
this._input.getControl().setValue(this._values[this.context] || '');
}
const selectComponent = this.selectComponentRef.current;
if (selectComponent && selectComponent.value !== this.context) {
selectComponent.value = this.context;
}
this.selectNodeRoot.render(<SelectComponent
defaultValue={this.context} onChange={this.updateInput}
options={[
{ value: 'condition', label: nls.localizeByDefault('Expression') },
{ value: 'hitCondition', label: nls.localizeByDefault('Hit Count') },
{ value: 'logMessage', label: nls.localizeByDefault('Log Message') },
]}
ref={this.selectComponentRef}
/>);
}

Expand Down
Loading