mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-30 17:33:21 +08:00
different coalescing key for touchCancel events
Summary: On iPad we may get two touch cancel events in direct succession. They would have the same coalescing key, which would result in unsuccesful attempt to coalesce them. This diff fixes it by making sure two cancel events cannot have the same coalescing key. (An alternative fix would be implementing coalescing logic for cancel events, but that sounds more complicated. It would be neccessary if there is a legit scenario where big number of cancel events are emitted in succesion.) Reviewed By: javache Differential Revision: D3292405 fbshipit-source-id: 1f269771dc81fdd637cf6ac3ee4725e5e2fec679
This commit is contained in:
committed by
Facebook Github Bot 6
parent
428c563c75
commit
44bf85a041
@@ -295,6 +295,7 @@ static BOOL RCTAnyTouchesChanged(NSSet<UITouch *> *touches)
|
||||
{
|
||||
[super touchesCancelled:touches withEvent:event];
|
||||
|
||||
_coalescingKey++;
|
||||
if (_dispatchedInitialTouches) {
|
||||
[self _updateAndDispatchTouches:touches eventName:@"touchCancel" originatingTime:event.timestamp];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user