diff --git a/src/dom.ts b/src/dom.ts
index ab2c3a05faf33..b8f7ecc693724 100644
--- a/src/dom.ts
+++ b/src/dom.ts
@@ -571,4 +571,5 @@ export const setFileInputFunction = async (element: HTMLInputElement, payloads:
dt.items.add(file);
element.files = dt.files;
element.dispatchEvent(new Event('input', { 'bubbles': true }));
+ element.dispatchEvent(new Event('change', { 'bubbles': true }));
};
diff --git a/test/input.spec.js b/test/input.spec.js
index 4a78afa06a7a3..68896323912ba 100644
--- a/test/input.spec.js
+++ b/test/input.spec.js
@@ -193,17 +193,19 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
path.relative(process.cwd(), __dirname + '/assets/pptr.png')).catch(e => error = e);
expect(error).not.toBe(null);
});
- it('should emit input change event', async({page, server}) => {
+ it('should emit input and change events', async({page, server}) => {
const events = [];
await page.exposeFunction('eventHandled', e => events.push(e));
await page.setContent(`
`);
await (await page.$('input')).setInputFiles(FILE_TO_UPLOAD);
- expect(events.length).toBe(1);
+ expect(events.length).toBe(2);
expect(events[0].type).toBe('input');
+ expect(events[1].type).toBe('change');
});
});