From cc08b9e799834b3bdb15e06af2d260ecf8ffcb7c Mon Sep 17 00:00:00 2001 From: David Peter Date: Sat, 15 Dec 2018 15:52:25 -0800 Subject: [PATCH 1/2] Add focusin/focusout events. --- src/__tests__/events.js | 2 +- src/events.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/__tests__/events.js b/src/__tests__/events.js index 2743ff39..a53fdf8b 100644 --- a/src/__tests__/events.js +++ b/src/__tests__/events.js @@ -20,7 +20,7 @@ const eventTypes = [ }, { type: 'Focus', - events: ['focus', 'blur'], + events: ['focus', 'blur', 'focusIn', 'focusOut'], elementType: 'input', }, { diff --git a/src/events.js b/src/events.js index 5f3a083b..9c33ac3f 100644 --- a/src/events.js +++ b/src/events.js @@ -47,6 +47,14 @@ const eventMap = { EventType: 'FocusEvent', defaultInit: {bubbles: false, cancelable: false}, }, + focusIn: { + EventType: 'FocusEvent', + defaultInit: {bubbles: true, cancelable: false}, + }, + focusOut: { + EventType: 'FocusEvent', + defaultInit: {bubbles: true, cancelable: false}, + }, // Form Events change: { EventType: 'InputEvent', From 5533fd68a77a0efc4a757bf9f8f5d4fac29f1fba Mon Sep 17 00:00:00 2001 From: David Peter Date: Sat, 15 Dec 2018 15:54:55 -0800 Subject: [PATCH 2/2] Add self to contributors. --- .all-contributorsrc | 9 +++++++++ README.md | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 11163e3b..e73a5bd7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -449,6 +449,15 @@ "contributions": [ "code" ] + }, + { + "login": "sarenji", + "name": "David Peter", + "avatar_url": "https://avatars2.githubusercontent.com/u/167743?v=4", + "profile": "http://davidpeter.me", + "contributions": [ + "code" + ] } ] } diff --git a/README.md b/README.md index 5cea8e5a..119237c8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [![downloads][downloads-badge]][npmtrends] [![MIT License][license-badge]][license] -[![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-46-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] @@ -1176,7 +1176,7 @@ Thanks goes to these people ([emoji key][emojis]): | [
Jonathan Stoye](http://jonathanstoye.de)
[📖](https://github.com/kentcdodds/dom-testing-library/commits?author=JonathanStoye "Documentation") | [
Sanghyeon Lee](https://github.com/yongdamsh)
[💡](#example-yongdamsh "Examples") | [
Justice Mba ](https://github.com/Dajust)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=Dajust "Code") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=Dajust "Documentation") [🤔](#ideas-Dajust "Ideas, Planning, & Feedback") | [
Wayne Crouch](https://github.com/wgcrouch)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=wgcrouch "Code") | [
Ben Elliott](http://benjaminelliott.co.uk)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=benelliott "Code") | [
Ruben Costa](http://nuances.co)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=rubencosta "Code") | [
Robert Smith](http://rbrtsmith.com/)
[🐛](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3Arbrtsmith "Bug reports") [🤔](#ideas-rbrtsmith "Ideas, Planning, & Feedback") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=rbrtsmith "Documentation") | | [
dadamssg](https://github.com/dadamssg)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=dadamssg "Code") | [
Neil Kistner](https://neilkistner.com/)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=wyze "Code") | [
Ben Chauvette](http://bdchauvette.net/)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=bdchauvette "Code") | [
Jeff Baumgardt](https://github.com/JeffBaumgardt)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=JeffBaumgardt "Code") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=JeffBaumgardt "Documentation") | [
Matan Kushner](http://matchai.me)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=matchai "Code") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=matchai "Documentation") [🤔](#ideas-matchai "Ideas, Planning, & Feedback") [⚠️](https://github.com/kentcdodds/dom-testing-library/commits?author=matchai "Tests") | [
Alex Wendte](http://www.wendtedesigns.com/)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=themostcolm "Code") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=themostcolm "Documentation") [⚠️](https://github.com/kentcdodds/dom-testing-library/commits?author=themostcolm "Tests") | [
Tamas Fodor](https://github.com/ruffle1986)
[📖](https://github.com/kentcdodds/dom-testing-library/commits?author=ruffle1986 "Documentation") | | [
Benjamin Eckardt](https://github.com/BenjaminEckardt)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=BenjaminEckardt "Code") | [
Ryan Campbell](https://github.com/campbellr)
[📖](https://github.com/kentcdodds/dom-testing-library/commits?author=campbellr "Documentation") | [
Taylor Briggs](https://taylor-briggs.com)
[⚠️](https://github.com/kentcdodds/dom-testing-library/commits?author=TaylorBriggs "Tests") | [
John Gozde](https://github.com/jgoz)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=jgoz "Code") | [
C. T. Lin](https://github.com/chentsulin)
[📖](https://github.com/kentcdodds/dom-testing-library/commits?author=chentsulin "Documentation") | [
Terrence Wong](http://terrencewwong.com)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=terrencewwong "Code") | [
Soo Jae Hwang](https://www.ossfinder.com)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=misoguy "Code") | -| [
Royston Shufflebotham](https://github.com/RoystonS)
[🐛](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3ARoystonS "Bug reports") [💻](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Code") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Documentation") [⚠️](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Tests") | [
Vadim Brodsky](http://www.vadimbrodsky.com)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=VadimBrodsky "Code") | [
Eunjae Lee](https://twitter.com/eunjae_lee)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=eunjae-lee "Code") | +| [
Royston Shufflebotham](https://github.com/RoystonS)
[🐛](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3ARoystonS "Bug reports") [💻](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Code") [📖](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Documentation") [⚠️](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Tests") | [
Vadim Brodsky](http://www.vadimbrodsky.com)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=VadimBrodsky "Code") | [
Eunjae Lee](https://twitter.com/eunjae_lee)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=eunjae-lee "Code") | [
David Peter](http://davidpeter.me)
[💻](https://github.com/kentcdodds/dom-testing-library/commits?author=sarenji "Code") |