Commit Graph

58 Commits

Author SHA1 Message Date
Simen Bekkhus
cf0081263c Upgrade to jest 25 (#17896)
The changes to the test code relate to changes in JSDOM that come with Jest 25:

* Several JSDOM workarounds are no longer needed.
* Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers.
  * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh
* JSDOM no longer triggers default actions when dispatching click events.
  * https://codesandbox.io/s/beautiful-cdn-ugn8f
* JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent.
* JSDOM now supports passive events.
* JSDOM has improved support for custom CSS properties.
  * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
2020-01-25 08:43:02 -08:00
Nicolas Gallagher
81e30c7ff6 Remove unused modules from legacy event responders (#17907) 2020-01-24 10:50:27 -08:00
Nicolas Gallagher
6c00c5bba4 Update to flow-bin@0.89 (#17842) 2020-01-22 10:02:30 -08:00
Dominic Gannaway
9e075d16b2 [react-interactions] Remove deprecated Scope APIs + update Focus components/docs (#17859) 2020-01-17 12:16:39 +00:00
Dominic Gannaway
b6173e643a [react-interactions] Add DO_NOT_USE to Scope methods (#17835) 2020-01-15 09:50:09 +00:00
Dan Abramov
e706721490 Update Flow to 0.84 (#17805)
* Update Flow to 0.84

* Fix violations

* Use inexact object syntax in files from fbsource

* Fix warning extraction to use a modern parser

* Codemod inexact objects to new syntax

* Tighten types that can be exact

* Revert unintentional formatting changes from codemod
2020-01-09 14:50:44 +00:00
Dan Abramov
b979db4e72 Bump Prettier (#17811)
* Bump Prettier

* Reformat

* Use non-deprecated option
2020-01-09 13:54:11 +00:00
Dominic Gannaway
5e21157d86 [react-interactions] Fix Hover issues with portals (#17765) 2020-01-07 19:45:26 +00:00
Nicolas Gallagher
72592310a8 Create packages/dom-event-testing-library (#17660)
Moves the unit testing library for events into the `packages` directory so it can more easily be used in tests for other react packages, and mirrored internally to help with testing of event hooks we prototype in www.
2019-12-19 16:51:25 +00:00
Nicolas Gallagher
a5e951d4cc [react-interactions] Event testing library improvements (#17614)
Introduces a state machine around pointer events to produce more accurate mock
touch events. This allows multi-touch unit tests to be written entirely in
terms of mock pointer interactions, while producing the expected
'changedTouches', 'targetTouches', and 'touches' fields for mock touch events.
2019-12-18 23:32:48 +00:00
Dominic Gannaway
9fe1031244 [react-interactions] Rename Flare APIs to deprecated and remove from RN (#17644) 2019-12-18 10:24:46 +00:00
Dan Abramov
0cf22a56a1 Use console directly instead of warning() modules (#17599)
* Replace all warning/lowPriWarning with console calls

* Replace console.warn/error with a custom wrapper at build time

* Fail the build for console.error/warn() where we can't read the stack
2019-12-14 18:09:25 +00:00
Nicolas Gallagher
612a76812f [react-interactions] Mock touchend events should use empty array for 'touches' (#17589)
The 'touches' value should be an empty array rather than 'null'
2019-12-12 22:21:30 +00:00
Laura buns
9ac42dd074 Remove the condition argument from warning() (#17568)
* prep for codemod

* prep warnings

* rename lint rules

* codemod for ifs

* shim www functions

* Handle more cases in the transform

* Thanks De Morgan

* Run the codemod

* Delete the transform

* Fix up confusing conditions manually

* Fix up www shims to match expected API

* Also check for low-pri warning in the lint rule
2019-12-11 03:28:14 +00:00
Dominic Gannaway
3c1efa0d77 [react-interactions] Remove Focus/FocusWithin root event types (#17555) 2019-12-09 14:27:45 +00:00
Nicolas Gallagher
9e937e7e86 [react-interactions] fix Press/Tap behavior for virtual middle clicks (#17554)
Tools like BetterTouchTool for macOS trigger middle-clicks with a 'buttons'
value that doesn't correspond to the middle-mouse button. To account for this
we also inspect the value of 'button'.

Close #17367
2019-12-09 13:04:24 +00:00
Dominic Gannaway
acfe4b21b2 [react-interactions] Upgrade passive event listeners to active listeners (#17513) 2019-12-04 19:30:50 +00:00
Dominic Gannaway
3fdfa231ad [react-interactions] Refine virtual click detection for FF+JAWS/NVDA (#17422) 2019-11-21 13:09:30 +00:00
Dominic Gannaway
a7d07ff24d [react-interactions] Rename Flare listeners prop to DEPRECATED_flareListeners (#17394) 2019-11-18 13:32:50 +00:00
Dominic Gannaway
532810a370 [react-interactions] FocusWithin beforeblur propagation fix (#17375) 2019-11-15 12:05:00 +00:00
Dominic Gannaway
fc43644eba [react-interactions] Follow up active element blur logic (#17364) 2019-11-14 11:55:50 +00:00
Dominic Gannaway
a61886b16b [react-interactions] Refine custom active element blur logic (#17354) 2019-11-13 20:46:00 +00:00
Dominic Gannaway
e701632ad4 [react-interactions] Change unmount blur logic to a dedicated event (#17291) 2019-11-07 10:27:02 +00:00
Dominic Gannaway
cd1bdcd067 [react-interactions] Prevent duplicate onPress firing for keyboard Enter (#17266)
* [react-interactions] Prevent duplicate onPress firing for keyboard Enter

* address feedback
2019-11-05 23:28:26 +00:00
Dominic Gannaway
cb09dbe0ab [react-interactions] Add handleSimulateChildBlur upon DOM node removal (#17225)
* [react-interactions] Add handleSimulateChildBlur upon DOM node removal
2019-11-04 20:02:45 +00:00
Andrew Clark
6dc2734b41 Codemod tests to it.experimental (#17243)
`it.experimental` marks that a test only works in Experimental builds.

It also asserts that a test does *not* work in the stable builds. The
main benefit is that we're less likely to accidentally expose an
experimental API before we intend. It also forces us to un- mark an
experimental test once it become stable.
2019-11-01 10:20:08 -07:00
Dominic Gannaway
f7ec65eeba [react-interactions] Make events non-passive to allow preventDefault (#17136) 2019-10-21 22:37:27 +02:00
Nicolas Gallagher
4fb5bf61dd [react-interactions] Fix focus-visible heuristic (#17124)
Respond to all keys not just `Tab`
2019-10-17 09:24:31 -07:00
Dominic Gannaway
8facc05373 [react-interactions] Allow event.preventDefault on LegacyPress responder (#17113)
[react-interactions] Allow event.preventDefault on LegacyPress responder
2019-10-17 10:21:02 +02:00
Dominic Gannaway
916937563b [react-interactions] Add onFocusWithin event to FocusWithin responder (#17115) 2019-10-16 22:57:08 +02:00
Andrew Clark
30c5daf943 Remove concurrent apis from stable (#17088)
* Tests run in experimental mode by default

For local development, you usually want experiments enabled. Unless
the release channel is set with an environment variable, tests will
run with __EXPERIMENTAL__ set to `true`.

* Remove concurrent APIs from stable builds

Those who want to try concurrent mode should use the experimental
builds instead.

I've left the `unstable_` prefixed APIs in the Facebook build so we
can continue experimenting with them internally without blessing them
for widespread use.

* Turn on SSR flags in experimental build

* Remove prefixed concurrent APIs from www build

Instead we'll use the experimental builds when syncing to www.

* Remove "canary" from internal React version string
2019-10-15 15:09:19 -07:00
Dominic Gannaway
4cb399a433 [react-interactions] Modify Scope query mechanism (#17095) 2019-10-15 15:57:02 +02:00
Dominic Gannaway
b71ab61c8f [react-interactions] Adds more experimental Scope API methods (#17042) 2019-10-08 19:32:53 +02:00
Dominic Gannaway
55731fd8ce [react-interactions] Refine a11y component flow types (#17032) 2019-10-07 16:36:16 +02:00
Dominic Gannaway
fff5b1ca77 [react-interactions] Add FocusTable colSpan support (#17019) 2019-10-07 12:04:41 +02:00
Dominic Gannaway
4c5698400f [react-interactions] Remove context.setTimeout & context.clearTimeout (#17000) 2019-10-03 13:37:37 +02:00
Dominic Gannaway
b33633d932 [react-interactions] Repurpose React a11y modules (#16997) 2019-10-03 11:19:24 +02:00
Nicolas Gallagher
f6efb224b0 [react-interactions] Tap cancels on second pointerdown (#16936)
This patch causes onTapCancel to be called whenever a second pointer interacts
with the responder target.
2019-10-01 15:13:31 -07:00
Dominic Gannaway
34457729a6 [react-interactions] Add allowModifiers flag to FocusList + FocusTable (#16971) 2019-10-01 17:59:52 +02:00
Dominic Gannaway
ac8e8b3278 [react-interactions] Add tab handling to FocusList (#16958) 2019-09-30 17:13:35 +02:00
Dominic Gannaway
10c7dfe3b4 [react-interactins] FocusTable tabScope handling+tabIndex control (#16922) 2019-09-30 11:41:20 +02:00
Sebastian Markbåge
9d637844e9 Remove enableUserBlockingEvents flag (#16882)
Seems like this worked out. We can clean up the flag now.
2019-09-27 19:46:56 -07:00
Nicolas Gallagher
d1121c0174 [react-interactions] Fix virtual click heuristic (#16915) 2019-09-27 15:38:47 -07:00
Dominic Gannaway
b9811ed5bc [react-interactions] Add wrapping support to FocusList/FocusTable (#16903) 2019-09-26 15:15:48 +02:00
Dominic Gannaway
4bb0e96b4b [react-interactions] FocusTable key press bound propgataion (#16895) 2019-09-25 21:12:39 +02:00
Dominic Gannaway
7c3bd08b37 [react-interactions] Add more documentation for a11y components (#16894) 2019-09-25 19:01:15 +02:00
Dominic Gannaway
d6d83d7060 [react-interactions] Add Portal propagation configuration (#16889) 2019-09-25 16:56:51 +02:00
Dominic Gannaway
d0ebde77f6 [react-interactions] Add initial docs explaining React Scopes (#16892) 2019-09-25 14:57:47 +02:00
Dominic Gannaway
ebc299fc2f [react-interactions] TabFocus -> FocusManager (#16874) 2019-09-24 23:26:20 +02:00
Dominic Gannaway
793f176dad [react-interactions] Make FocusList bundle (#16876) 2019-09-24 18:02:13 +02:00