fix: emit focus/blur events for webview (#14344)
* fix: emit focus/blur events for webview * test: webview can emit focus event
This commit is contained in:
parent
edd5c4b9bb
commit
459a2304b4
5 changed files with 53 additions and 21 deletions
|
@ -1294,6 +1294,19 @@ describe('<webview> tag', function () {
|
|||
expect(secondResizeEvent.newWidth).to.equal(newWidth)
|
||||
expect(secondResizeEvent.newHeight).to.equal(newHeight)
|
||||
})
|
||||
|
||||
it('emits focus event', async () => {
|
||||
const domReadySignal = waitForEvent(webview, 'dom-ready')
|
||||
webview.src = `file://${fixtures}/pages/a.html`
|
||||
document.body.appendChild(webview)
|
||||
|
||||
await domReadySignal
|
||||
|
||||
const focusSignal = waitForEvent(webview, 'focus')
|
||||
webview.contentWindow.focus()
|
||||
|
||||
await focusSignal
|
||||
})
|
||||
})
|
||||
|
||||
describe('zoom behavior', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue