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

The modifiers option in click doesn't work #1459

Open
ankur22 opened this issue Oct 4, 2024 · 0 comments
Open

The modifiers option in click doesn't work #1459

ankur22 opened this issue Oct 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Oct 4, 2024

Brief summary

When trying to do this:

await page.locator('a[href="/my_messages.php"]').click({modifiers: ['ControlOrMeta']})

The modifiers are ignored and the link does not open in a new window. It looks like we're forgetting about the modifiers -- opts.ToMouseClickOptions() and handle.click don't work with the modifier.

The current workaround is to hold down the meta key before clicking:

  await page.keyboard.down('ControlOrMeta');

  await page.locator('a[href="/my_messages.php"]').click()

  await page.keyboard.up('ControlOrMeta');

xk6-browser version

v1.8.5

OS

NA

Chrome version

NA

Docker version and image (if applicable)

No response

Steps to reproduce the problem

NA

Expected behaviour

The link is opened in a new page/tab.

Actual behaviour

The link navigates on the current page.

@ankur22 ankur22 added the bug Something isn't working label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant