React Events: core API documentation followup (#15506)
Dominic Gannaway committed
Apr 26, 2019 at 15:47 UTC
c4d1dcb533c2ff32bb9eedf562e5f4dba21fe7a6
1 file changed
+13
-5
packages/react-events/README.md
+13
-5
@@ -71,7 +71,7 @@ Called after an Event Component in mounted.
71
72
### onOwnershipChange?: (context: ResponderContext, props, state)
73
74
-Called when responder ownership is granted or terminated for an Event Component instance.
74
+Called when ownership is granted or terminated (either globally or for the responder) for an Event Component instance.
75
76
### onRootEvent?: (event: ResponderEvent, context: ResponderContext, props, state)
77
@@ -148,11 +148,12 @@ Returns `true` is the target element is within the subtree of the Event Componen
148
149
### isTargetWithinEventResponderScope(target: Element): boolean
150
151
-Returns `true` is the target element is within the current responder.
151
+Returns `true` is the target element is within the current Event Component instance's responder. If the target element
152
+is within the scope of the same responder, but owned by another Event Component instance, this will return `false`.
153
154
### releaseOwnership(): boolean
155
155
-Returns `true` if the instance released ownership of the responder.
156
+Returns `true` if the instance released ownership of the Event Component instance.
157
158
### removeRootEventTypes(eventTypes: Array<ResponderEventType>)
159
@@ -160,11 +161,18 @@ Remove the root event types added with `addRootEventTypes`.
161
162
### requestGlobalOwnership(): boolean
163
163
-Request ownership of the global responder.
164
+The current Event Component instance can request global ownership of the event system. When an Event Component instance
165
+has global ownership, only that instance and its responder are active. To release ownership to other event responders,
166
+either `releaseOwnership()` must be called or the Event Component instance that had global ownership must be
167
+unmounted. Calling `requestGlobalOwnership` also returns `true`/`false` if the request was successful.
168
169
### requestResponderOwnership(): boolean
170
167
-Request ownership of the responder.
171
+The current Event Component instance can request responder ownership within the event system. When an Event Component
172
+instance has responder ownership, all other Event Component instances that have the same responder as the Event Component
173
+instance will no longer be active. To release ownership to other event responders, either `releaseOwnership()` must be
174
+called or the Event Component instance that had global ownership must be unmounted. Calling `requestResponderOwnership`
175
+also returns `true`/`false` if the request was successful.
176
177
### setTimeout(func: () => void, delay: number): Symbol
178