mirror of
https://github.com/coder/code-server.git
synced 2026-05-09 05:47:26 +02:00
chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@@ -76,23 +76,26 @@ export class TextInputActionsProvider extends Disposable implements IWorkbenchCo
|
||||
|
||||
// Context menu support in input/textarea
|
||||
this.layoutService.container.addEventListener('contextmenu', e => this.onContextMenu(e));
|
||||
|
||||
}
|
||||
|
||||
private onContextMenu(e: MouseEvent): void {
|
||||
if (e.target instanceof HTMLElement) {
|
||||
const target = <HTMLElement>e.target;
|
||||
if (target.nodeName && (target.nodeName.toLowerCase() === 'input' || target.nodeName.toLowerCase() === 'textarea')) {
|
||||
EventHelper.stop(e, true);
|
||||
|
||||
this.contextMenuService.showContextMenu({
|
||||
getAnchor: () => e,
|
||||
getActions: () => this.textInputActions,
|
||||
getActionsContext: () => target,
|
||||
onHide: () => target.focus() // fixes https://github.com/microsoft/vscode/issues/52948
|
||||
});
|
||||
}
|
||||
if (e.defaultPrevented) {
|
||||
return; // make sure to not show these actions by accident if component indicated to prevent
|
||||
}
|
||||
|
||||
const target = e.target;
|
||||
if (!(target instanceof HTMLElement) || (target.nodeName.toLowerCase() !== 'input' && target.nodeName.toLowerCase() !== 'textarea')) {
|
||||
return; // only for inputs or textareas
|
||||
}
|
||||
|
||||
EventHelper.stop(e, true);
|
||||
|
||||
this.contextMenuService.showContextMenu({
|
||||
getAnchor: () => e,
|
||||
getActions: () => this.textInputActions,
|
||||
getActionsContext: () => target,
|
||||
onHide: () => target.focus() // fixes https://github.com/microsoft/vscode/issues/52948
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user