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

EditContext: Removing the text area dom node on disposal #234419

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

aiday-mar
Copy link
Contributor

polish

@aiday-mar aiday-mar self-assigned this Nov 22, 2024
@aiday-mar aiday-mar marked this pull request as ready for review November 22, 2024 13:35
@aiday-mar aiday-mar enabled auto-merge (squash) November 22, 2024 13:35
@aiday-mar aiday-mar changed the title Removing the text area dom node on disposal EditContext: Removing the text area dom node on disposal Nov 22, 2024
@vs-code-engineering vs-code-engineering bot added this to the November 2024 milestone Nov 22, 2024
Comment on lines 168 to 171
this.domNode.domNode.blur();
this.domNode.domNode.remove();
this.textArea.domNode.remove();
super.dispose();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I prefer this approach so we don't need to override:

this._register(toDisposable(() => {
	// Force blue the dom node so can write in pane with no native edit context after disposal
	this.domNode.domNode.blur();
	this.domNode.domNode.remove();
	this.textArea.domNode.remove();
}));

Copy link
Contributor Author

@aiday-mar aiday-mar Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yep thanks for the advice, indeed it removes the override

@aiday-mar aiday-mar merged commit 5498244 into main Nov 22, 2024
8 checks passed
@aiday-mar aiday-mar deleted the breakable-swallow branch November 22, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants