Skip to content
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

[Regression]: Pressing Tab in Firefox does not trigger blur event #32339

Open
sissbruecker opened this issue Aug 27, 2024 · 1 comment
Open

Comments

@sissbruecker
Copy link

sissbruecker commented Aug 27, 2024

Last Good Version

1.43.1

First Bad Version

1.44.0

Steps to reproduce

  1. Clone repo at https://github.com/sissbruecker/playwright-firefox-blur-on-tab-regression
  2. Run npm install
  3. Run npx playwright install firefox
  4. Run npx playwright test

Expected behavior

The test should pass.

For reference, the test setup:

<label for="test">test</label>
<input id="test">

<script>
  const input = document.getElementById('test');
  input.addEventListener('blur', () => {
    const text = document.createElement('p');
    text.textContent = "Input was blurred";
    document.body.appendChild(text);
  })
</script>

And the the test:

  await page.goto('/');
  await page.getByLabel("test").click();
  await page.keyboard.press("Tab");

  await expect(page.getByText("Input was blurred")).toBeVisible();

Actual behavior

The last assertion fails because the blur listener did not run.

Additional context

  • The issue is still present in 1.46.1.
  • The test setup is in index.html
  • From debugging this it looks like focus changes but the blur event is not fired.
  • The test works with Chromium
  • The test fails with Webkit, though the regression seems to have been introduced earlier for Webkit

Environment

System:
    OS: macOS 13.6
    CPU: (10) arm64 Apple M1 Pro
    Memory: 2.77 GB / 32.00 GB
  Binaries:
    Node: 20.9.0 - /var/folders/m0/_cm1wj395tq_4r1nqwq5dg2h0000gn/T/fnm_multishells/75765_1724762438045/bin/node
    Yarn: 1.22.22 - /var/folders/m0/_cm1wj395tq_4r1nqwq5dg2h0000gn/T/fnm_multishells/75765_1724762438045/bin/yarn
    npm: 10.1.0 - /var/folders/m0/_cm1wj395tq_4r1nqwq5dg2h0000gn/T/fnm_multishells/75765_1724762438045/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.44.0 => 1.44.0
@yury-s
Copy link
Member

yury-s commented Aug 27, 2024

Failing in WebKit too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants