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

Get pointer targets in environments that support layout #846

Open
ph-fritsche opened this issue Feb 3, 2022 · 1 comment
Open

Get pointer targets in environments that support layout #846

ph-fritsche opened this issue Feb 3, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@ph-fritsche
Copy link
Member

Problem description

An increasing number of our users applies this library in test environments which support layout.
In those environments given the clientX/clientY coordinates of a pointer device, we could detect the target of pointer interactions automatically and improve the confidence our users get from their tests.

Suggested solution

If a user supplies x/y coordinates for pointer interactions, determine related DOM node(s) and position automatically.

If a target and or node/offset is given and contradicts the determined element/position, throw an error.

Todo

It would be great if we could support not declaring a target in the API call.
So far we reuse the previous pointer position for subsequent pointer actions. This begs the question how we would determine if we keep the coordinates and/or the target as a reference point.

@ph-fritsche ph-fritsche added the enhancement New feature or request label Feb 3, 2022
@ph-fritsche
Copy link
Member Author

@ghengeveld Storybook integration certainly increases the number of people for whom this might be relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant