End slider interaction when touches are cancelled

Reviewed By: @jingc

Differential Revision: D2479259
This commit is contained in:
Pieter De Baets 2015-09-25 11:36:13 -07:00 committed by facebook-github-bot-6
parent ec8b5425e5
commit 8f13560fd5
2 changed files with 4 additions and 3 deletions

View File

@ -242,7 +242,7 @@ static BOOL RCTAnyTouchesChanged(NSSet *touches)
{
[super touchesBegan:touches withEvent:event];
// "start" has to record new touches beforeckirjiuhucekbebjditeucultigvijfe extracting the event.
// "start" has to record new touches before extracting the event.
// "end"/"cancel" needs to remove the touch *after* extracting the event.
[self _recordNewTouches:touches];
if (_dispatchedInitialTouches) {

View File

@ -22,8 +22,9 @@ RCT_EXPORT_MODULE()
{
RCTSlider *slider = [RCTSlider new];
[slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
[slider addTarget:self action:@selector(sliderTouchEnd:) forControlEvents:UIControlEventTouchUpInside];
[slider addTarget:self action:@selector(sliderTouchEnd:) forControlEvents:UIControlEventTouchUpOutside];
[slider addTarget:self action:@selector(sliderTouchEnd:) forControlEvents:(UIControlEventTouchUpInside |
UIControlEventTouchUpOutside |
UIControlEventTouchCancel)];
return slider;
}