Skip to content

Commit f9ab42a

Browse files
authored
Fix the 'type code here' to disappear appropriately. (#12336)
* Fix overlay showing up when it's not supposed to * Add news entry
1 parent 01b6114 commit f9ab42a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

news/2 Fixes/11691.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Watermark in the interactive window can appear on top of entered text.

src/datascience-ui/react-common/monacoEditor.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class MonacoEditor extends React.Component<IMonacoEditorProps, IMonacoEdi
437437

438438
public setValue(text: string, cursorPos: CursorPos) {
439439
if (this.state.model && this.state.editor && this.state.model.getValue() !== text) {
440-
this.forceValue(text, cursorPos);
440+
this.forceValue(text, cursorPos, true);
441441
}
442442
}
443443

@@ -469,19 +469,18 @@ export class MonacoEditor extends React.Component<IMonacoEditorProps, IMonacoEdi
469469
}
470470
}
471471

472-
private forceValue(text: string, cursorPos: CursorPos | monacoEditor.IPosition) {
472+
private forceValue(text: string, cursorPos: CursorPos | monacoEditor.IPosition, allowNotifications?: boolean) {
473473
if (this.state.model && this.state.editor) {
474474
// Save current position. May need it to update after setting.
475475
const current = this.state.editor.getPosition();
476476

477-
// Disable change notifications as we know this
478-
// is different.
479-
this.skipNotifications = true;
477+
// Disable change notifications if forcing this value should not allow them
478+
this.skipNotifications = allowNotifications ? false : true;
480479

481480
// Close any suggestions that are open
482481
this.closeSuggestWidget();
483482

484-
// Change our text. This shouldn't fire an update to the model
483+
// Change our text.
485484
this.previousModelValue = text;
486485
this.state.model.setValue(text);
487486

0 commit comments

Comments
 (0)