How to get the file chooser window to close using Puppeteer?

I’m using Puppeteer to upload a file from my desktop to a website. It does upload the file, but the file explorer window stays opened and so the automation stops working.

const [fileCHooser] = await Promise.all([
        page.waitForFileChooser(),
        page.click("upload button id"),
    ]);

    await fileCHooser.accept(["dektop/example.csv"]);

Is there a way I can force it to close?