fix: emit context-menu
event in Windows draggable regions (#46032)
fix: emit context-menu event in Windows draggable regions Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
a3af41674f
commit
a1ec212049
3 changed files with 29 additions and 5 deletions
|
@ -2896,8 +2896,13 @@ describe('webContents module', () => {
|
|||
expect(contextMenuEmitCount).to.equal(1);
|
||||
});
|
||||
|
||||
ifit(process.platform !== 'win32')('emits when right-clicked in page in a draggable region', async () => {
|
||||
it('emits when right-clicked in page in a draggable region', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
w.on('system-context-menu', (event) => { event.preventDefault(); });
|
||||
}
|
||||
|
||||
await w.loadFile(path.join(fixturesPath, 'pages', 'draggable-page.html'));
|
||||
|
||||
const promise = once(w.webContents, 'context-menu') as Promise<[any, Electron.ContextMenuParams]>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue