We are developing an vscode extension with webview. In the webview, we are performing below steps
- Select the text
- Right Click
- Cut+Copy+Paste context menu appears
- Click on Copy

- Expected Result: Text should be copied to clipboard
- Actual Result: Text is not getting copied.
Note: Instead of using Context Menu, if we just press Ctrl+C, the text is actually getting copied.
Debug Result
We have debugged further and found the one difference between Ctrl+C key-press and clicking COPY from context-menu in editorExtensions.ts file.
For, Ctrl+C, webview implementation is returning TRUE

for COPY, generic-dom implementation is returning TRUE

public runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {
const logService = accessor.get(ILogService);
logService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);
for (const impl of this._implementations) {
const result = impl.implementation(accessor, args);
if (result) {
logService.trace(`Command '${this.id}' was handled by '${impl.name}'.`);
if (typeof result === 'boolean') {
return;
}
return result;
}
}
logService.trace(`The Command '${this.id}' was not handled by any implementation.`);
}
So, we need help to
- Find the reason why COPY context menu is not working and how to make it work
- How to make CUT/PASTE context menu disabled/grey-out
