Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from Astrocoders/bugfix/avoid-long-press-blink
Browse files Browse the repository at this point in the history
fix(long-press): add check for wrong location onLongPress
  • Loading branch information
georgelima authored May 17, 2019
2 parents 264136a + ce1ab73 commit dce8769
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ios/RNSelectableTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ -(void) handleLongPress: (UILongPressGestureRecognizer *) gesture
const NSInteger location = [_backedTextInputView offsetFromPosition:beginning toPosition:selectionStart];
const NSInteger endLocation = [_backedTextInputView offsetFromPosition:beginning toPosition:selectionEnd];

if (location == 0 && endLocation == 0) return;

[_backedTextInputView select:self];
[_backedTextInputView setSelectedRange:NSMakeRange(location, endLocation - location)];
[self _handleGesture];
Expand Down

0 comments on commit dce8769

Please sign in to comment.