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

fix: replace pointer implementations #754

Merged
merged 12 commits into from
Oct 21, 2021
Merged

fix: replace pointer implementations #754

merged 12 commits into from
Oct 21, 2021

Conversation

ph-fritsche
Copy link
Member

@ph-fritsche ph-fritsche commented Oct 20, 2021

What:

Replace implementations of our pointer related APIs with calls to pointer.

Why:

One API to rule them all.

We still have a lot of workarounds scattered over the different implementations.

Replacing the previous implementations with our generalized approach in pointer highlights when the results of the new implementation differ. Sometimes pointer needs more work, sometimes the previous assumptions were wrong.

Checklist:

  • Tests
  • Ready to be merged

Non-trivial changes to the previous implementation
(aside added data like pointerId etc.)

  • *enter/*leave is not applied on every element in the tree.
    Misinterpretation of the following spec?

    The user agent MUST fire a pointer event named pointerenter when a pointing device is moved into the hit test boundaries of an element or one of its descendants

  • Disabled elements do not receive any pointer key events, but they receive every pointer move event.
  • Labels with disabled controls do work as any other element.

@ph-fritsche ph-fritsche changed the base branch from main to userEvent14 October 20, 2021 21:39
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 20, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1ffc0b1:

Sandbox Source
userEvent-PR-template Configuration

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #754 (1ffc0b1) into userEvent14 (9519979) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           userEvent14      #754    +/-   ##
==============================================
  Coverage       100.00%   100.00%            
==============================================
  Files               50        65    +15     
  Lines              965      1245   +280     
  Branches           389       469    +80     
==============================================
+ Hits               965      1245   +280     
Impacted Files Coverage Δ
src/paste.ts 100.00% <ø> (ø)
src/clear.ts 100.00% <100.00%> (ø)
src/click.ts 100.00% <100.00%> (ø)
src/document/applyNative.ts 100.00% <100.00%> (ø)
src/document/index.ts 100.00% <100.00%> (ø)
src/document/interceptor.ts 100.00% <100.00%> (ø)
src/document/selection.ts 100.00% <100.00%> (ø)
src/document/value.ts 100.00% <100.00%> (ø)
src/hover.ts 100.00% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 167413a...1ffc0b1. Read the comment docs.

@ph-fritsche ph-fritsche marked this pull request as ready for review October 21, 2021 00:38
@ph-fritsche ph-fritsche added this to the userEvent v14 milestone Oct 21, 2021
@ph-fritsche ph-fritsche merged commit 0a16a79 into userEvent14 Oct 21, 2021
@ph-fritsche ph-fritsche deleted the replace branch October 21, 2021 08:04
ph-fritsche added a commit that referenced this pull request Oct 21, 2021
* add dblclick event

* add `pointerId` and `pointerType` to `click`

* bind APIs to userEvent instance

* no mouse events on disabled elements

* fix which elements bubble

* replace hover implementation

* fix events on disabled elements

* fix button

* fix buttons

* replace click

* remove unused utils

* branch coverage

BREAKING CHANGE: The implementation of pointer related APIs was replaced.
This might break tests relying on unintended side-effects of the previous implementation.
ph-fritsche added a commit that referenced this pull request Nov 28, 2021
* add `pointerId` and `pointerType` to `click`

BREAKING CHANGE: The implementation of pointer related APIs was replaced.
This might break tests relying on unintended side-effects of the previous implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant