Skip to content

Commit

Permalink
Properly set the value of the select component in `DebugBreakpointWid…
Browse files Browse the repository at this point in the history
…get`

Fixes #12547.
  • Loading branch information
pisv committed May 26, 2023
1 parent c1a2b7b commit 0e089d0
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 0e089d0

Please sign in to comment.