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

Support Home and End key events #523

Closed
wants to merge 6 commits into from
Closed

Support Home and End key events #523

wants to merge 6 commits into from

Conversation

bozdoz
Copy link
Contributor

@bozdoz bozdoz commented Dec 18, 2020

What:

Add support for Home and End keys to userEvent.type

Why:

Useful for accessibility tests for a Tabs component for example (home and end move focus to first and last elements): https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html

How:

I modelled the changes after #511, adding two functions handleHome and handleEnd, two tests, and updated the README

Checklist:

  • Documentation
  • Tests
  • Typings
  • Ready to be merged

@bozdoz bozdoz changed the title Patch 1 Support Home and End key events Dec 18, 2020
@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #523 (7a54586) into master (d9b3e4e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #523   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          675       685   +10     
  Branches       211       211           
=========================================
+ Hits           675       685   +10     
Impacted Files Coverage Δ
src/type.js 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 d9b3e4e...7a54586. Read the comment docs.

@vasilii-kovalev
Copy link

vasilii-kovalev commented Dec 18, 2020

Thank you!
It is also necessary to adjust specialChars section and appropriate types.
@bozdoz, could you do that, please?

@curiosity26
Copy link
Contributor

I noticed this after creating #537. Sorry for the dupe. But I noticed this implementation doesn't encapsulate cursor positioning. FWIW I do handle cursor positioning with home and end in my PR

@ph-fritsche
Copy link
Member

Closing this as resolved by #536

@nickserv
Copy link
Member

This PR has some nice changes like updating the character table in the readme that weren't in #536. I can open a PR with anything that's missing and credit @bozdoz soon.

@ph-fritsche
Copy link
Member

Does 0d74a58 contain the missing changes?

@ph-fritsche
Copy link
Member

@nickmccurdy @bozdoz Could you confirm so that I could push it to master or add missing parts to it?

This was referenced Mar 18, 2021
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.

5 participants