-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Input change event on setInputFiles #924
Comments
It does for me, could you share your use case / code snippet? |
Hi, Here is my code, some sites handle file uploads with change event. (async () => {
const pw = require("playwright");
const browser = await pw.firefox.launch({
headless: true,
});
const context = await browser.newContext({
ignoreHTTPSErrors: true,
bypassCSP: true,
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0",
viewport: {
width: 1920,
height: 1040,
}
});
const page = await context.newPage();
page.on("console", msg => {
console.log(msg.text());
});
await page.setContent(`
<input type=file>
<script>
document.querySelector('input').addEventListener('change', () => {
console.log('Changed');
});
document.querySelector('input').addEventListener('input', () => {
console.log('Input');
});
</script>
`);
const input = await page.$('input[type="file"]');
await input.setInputFiles(__filename);
await browser.close();
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
setInputFiles not emitting the input change event.
The text was updated successfully, but these errors were encountered: