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: guard against selection without range #953

Merged
merged 1 commit into from May 12, 2022
Merged

fix: guard against selection without range #953

merged 1 commit into from May 12, 2022

Conversation

ph-fritsche
Copy link
Member

What:

Do nothing when trying to move cursor without a selection range.

Why:

Closes #901

How:

Check for selection?.focusNode.

Checklist:

  • Tests
  • Ready to be merged

Additional information
https://codesandbox.io/s/jovial-turing-q3mm8u?file=/src/App.test.js

@codesandbox-ci
Copy link

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 e6b230a:

Sandbox Source
userEvent-dom Configuration
userEvent-react Configuration
gallant-mendeleev-hdncvv PR

@codecov
Copy link

codecov bot commented May 12, 2022

Codecov Report

Merging #953 (e6b230a) into main (bf00145) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #953   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           85        85           
  Lines         1784      1785    +1     
  Branches       658       649    -9     
=========================================
+ Hits          1784      1785    +1     
Impacted Files Coverage Δ
src/utils/focus/selection.ts 100.00% <100.00%> (ø)

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 bf00145...e6b230a. Read the comment docs.

@ph-fritsche ph-fritsche merged commit ab78f3f into main May 12, 2022
@ph-fritsche ph-fritsche deleted the selection branch May 12, 2022 10:31
@github-actions
Copy link

🎉 This PR is included in version 14.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

userEvent.keyboard throws TypeError when using arrow keys
1 participant