adding coalescing key generation for scroll events
Reviewed By: javache Differential Revision: D3092857 fb-gh-sync-id: 79a1e235d97d484ee7247f17250759b161bc2c07 fbshipit-source-id: 79a1e235d97d484ee7247f17250759b161bc2c07
This commit is contained in:
parent
a37075dcec
commit
cefc5a66f2
|
@ -392,6 +392,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
|||
NSMutableArray<NSValue *> *_cachedChildFrames;
|
||||
BOOL _allowNextScrollNoMatterWhat;
|
||||
CGRect _lastClippedToRect;
|
||||
uint16_t _coalescingKey;
|
||||
RCTScrollEventType _lastEmittedEventType;
|
||||
}
|
||||
|
||||
@synthesize nativeScrollDelegate = _nativeScrollDelegate;
|
||||
|
@ -925,11 +927,15 @@ RCT_SET_AND_PRESERVE_OFFSET(setScrollIndicatorInsets, scrollIndicatorInsets, UIE
|
|||
scrollView:(UIScrollView *)scrollView
|
||||
userData:(NSDictionary *)userData
|
||||
{
|
||||
if (_lastEmittedEventType != type) {
|
||||
_coalescingKey++;
|
||||
_lastEmittedEventType = type;
|
||||
}
|
||||
[_eventDispatcher sendScrollEventWithType:type
|
||||
reactTag:reactTag
|
||||
scrollView:scrollView
|
||||
userData:userData
|
||||
coalescingKey:0];
|
||||
coalescingKey:_coalescingKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue