Only report selection changes if text view is still first responder.#1374
Only report selection changes if text view is still first responder.#1374SergioEstevao merged 2 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Thank you @SergioEstevao for taking care of this!
I was able to reproduce the issue on an iPad running iOS 13, and this PR solves the issue 🎉 .
I did notice some weirdness on selection while testing this PR, but it seems to be a completely different problem worthy of its own ticket:
Steps:
- Have a paragraph block with content.
- Select a word.
- Add a link to it.
- Open the link settings again.
- You will see no link and all the content from the block as
Link Text.
This is reproducible in both iOS 12 (from develop), and iOS 13 with the fix on this PR.
I wasn't able to reproduce it on Android, seems to be iOS only.
| extension RCTAztecView: UITextViewDelegate { | ||
|
|
||
| func textViewDidChangeSelection(_ textView: UITextView) { | ||
| guard isFirstResponder else { |
There was a problem hiding this comment.
Maybe we could add this statement to the previously existing guard?
Not sure if we get an advantage by having them separated.
@rachelmcr you are right! Looks like it's the same issue. Since it's already a separated ticket, let's 🚢 this one ✅ |

Fixes #1368
This PR makes sure that no selection changes are propagated after the aztec text view is no longer the first responder.
This way when the Link Modal interface is called and the URL input is activated (becomes the first responder) the selection change on the original Aztec content is not propagated to the link UI.
To test:
Update release notes:
RELEASE-NOTES.txt.