Skip to content

Commit

Permalink
Merge pull request #1382 from wordpress-mobile/hotfix/1.11.1
Browse files Browse the repository at this point in the history
Work around for link selection.
  • Loading branch information
SergioEstevao committed Sep 25, 2019
2 parents ad9edc1 + 73d7956 commit 72cbc1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg-mobile",
"version": "1.13.0",
"version": "1.13.1",
"private": true,
"config": {
"jsfiles": "./*.js src/*.js src/**/*.js src/**/**/*.js",
Expand Down
9 changes: 9 additions & 0 deletions react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -600,4 +600,13 @@ extension RCTAztecView: UITextViewDelegate {
func textViewDidEndEditing(_ textView: UITextView) {
onBlur?([:])
}

func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
// Sergio Estevao: This shouldn't happen in an editable textView, but it looks we have a system bug in iOS13 so we need this workaround
let position = characterRange.location
textView.selectedRange = NSRange(location: position, length: 0)
textView.typingAttributes = textView.attributedText.attributes(at: position, effectiveRange: nil)
textView.delegate?.textViewDidChangeSelection?(textView)
return false
}
}

0 comments on commit 72cbc1e

Please sign in to comment.