Skip to content

Commit

Permalink
debug: set the value of select component in DebugBreakpointWidget (#…
Browse files Browse the repository at this point in the history
…12567)

Fixes #12547.

The commit fixes an issue with the `DebugBreakpointWidget` where the current value in the select component was not properly set.
  • Loading branch information
pisv authored Jul 26, 2023
1 parent 0860f57 commit a75dd66
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 a75dd66

Please sign in to comment.