From e71f34ab44f3094acd2ffd19533c9c095e337273 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Sat, 21 Sep 2019 00:14:28 +0100 Subject: [PATCH 01/13] Don't allow interactions with URL in Aztec text blocks. --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 6fdb79d408f4c..4dd82f508a320 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -600,4 +600,8 @@ extension RCTAztecView: UITextViewDelegate { func textViewDidEndEditing(_ textView: UITextView) { onBlur?([:]) } + + func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool { + return false + } } From 25c4488de8b524733f280ed84489c1c1ab549345 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 24 Sep 2019 17:06:38 +0100 Subject: [PATCH 02/13] Move selection to the start of the URL. --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 4dd82f508a320..34a4b96349bf6 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -602,6 +602,8 @@ extension RCTAztecView: UITextViewDelegate { } func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool { + let position = characterRange.location as NSNumber + setSelection(start: position, end: position) return false } } From 0fec680f8cc734bd8ef39cd70eee3e4b7a9c0a40 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 24 Sep 2019 22:19:59 +0100 Subject: [PATCH 03/13] Make sure links selection is still possible. --- react-native-aztec/ios/RNTAztecView/RCTAztecView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 34a4b96349bf6..4ef8eae5b658b 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -602,8 +602,11 @@ extension RCTAztecView: UITextViewDelegate { } func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool { - let position = characterRange.location as NSNumber - setSelection(start: position, end: position) + // 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 } } From 39856db71360934633562f5fd5da2e22a9949dfc Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 27 Sep 2019 14:59:57 +0100 Subject: [PATCH 04/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 648a1b9280a34..9ca6705a1d233 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 648a1b9280a343c4b921781577a9d048db1d7027 +Subproject commit 9ca6705a1d2338fcad2ce1b65f53ef238b7d2959 From 71815cb341f071b50d44e05fa2763e026abe33ac Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 27 Sep 2019 15:37:59 +0100 Subject: [PATCH 05/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 9ca6705a1d233..9d79d2eac24c0 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 9ca6705a1d2338fcad2ce1b65f53ef238b7d2959 +Subproject commit 9d79d2eac24c0b2b81caf260c41374e982122cd9 From 9aaa7d6412e3945b4999d673e9bc1acc79e94646 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Sun, 29 Sep 2019 21:36:03 +0100 Subject: [PATCH 06/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 9d79d2eac24c0..b0ded8a711754 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 9d79d2eac24c0b2b81caf260c41374e982122cd9 +Subproject commit b0ded8a711754beacb075240a7662cea03a7a2f3 From 945626e1d88331f49bc5a133214c07afe5aba3fc Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 30 Sep 2019 11:25:22 +0100 Subject: [PATCH 07/13] Only apply selection fix on iOS 13.0.0 --- .../ios/RNTAztecView/RCTAztecView.swift | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 35acdf031ba91..78c1dc91e4351 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -611,11 +611,18 @@ extension RCTAztecView: UITextViewDelegate { } 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) + if #available(iOS 13.1, *) { + return false + } else if #available(iOS 13.0.0, *) { + // 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) + } else { + return false + } + return false } } From fbc1ad1ffa5a50e0367cd2aa74e466198d0715ff Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 30 Sep 2019 13:40:42 +0100 Subject: [PATCH 08/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index b0ded8a711754..95acf23ad5cbf 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit b0ded8a711754beacb075240a7662cea03a7a2f3 +Subproject commit 95acf23ad5cbf5ce7e62e9d62b8ee7c8eafef8aa From e0c41aaf35e177135a41bc0b58d7d1fbbea3a0a6 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 30 Sep 2019 16:39:07 +0100 Subject: [PATCH 09/13] Update release notes. --- RELEASE-NOTES.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 313e6d4e9a46b..0caf96dda2152 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,3 +1,8 @@ +1.14.0 +------ +* Fix a bug on iOS 13.0 were tapping on a link opens Safari +* Fix a link editing issue, where trying to add a empty link at the start of another link would remove the existing link. + 1.12.0 ------ * Add rich text styling to video captions From 040d5ad47eae0936048537e2be0522a7c3b128b2 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 30 Sep 2019 18:27:04 +0100 Subject: [PATCH 10/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 95acf23ad5cbf..a8ad454eae09e 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 95acf23ad5cbf5ce7e62e9d62b8ee7c8eafef8aa +Subproject commit a8ad454eae09ebff25ce8d8f0f56b96ed6c522ac From 36c11539ca36807d42b85570b42056cbb0104301 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 1 Oct 2019 00:20:28 +0100 Subject: [PATCH 11/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index a8ad454eae09e..fab417fc58ada 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit a8ad454eae09ebff25ce8d8f0f56b96ed6c522ac +Subproject commit fab417fc58adae811249c3fd319ebcf8814064cb From 16283de5650d738d31ff2537f8a592ec4c3c0f01 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 1 Oct 2019 09:29:35 +0100 Subject: [PATCH 12/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index fab417fc58ada..4661fbbf3a232 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit fab417fc58adae811249c3fd319ebcf8814064cb +Subproject commit 4661fbbf3a23220b1bc7ef8bd9ab94b16fc2a27d From e0e76bde163597a43f937b3ba923c976bd57fc2e Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 1 Oct 2019 10:17:22 +0100 Subject: [PATCH 13/13] Update GB reference. --- gutenberg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gutenberg b/gutenberg index 4661fbbf3a232..65c3745c25b96 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 4661fbbf3a23220b1bc7ef8bd9ab94b16fc2a27d +Subproject commit 65c3745c25b96bdac8e7ae4c01b6feb1e3944043