Skip to content

The modifiers option in click doesn't work #4312

Open
@ankur22

Description

@ankur22

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions