Open SD10 opened 6 years ago
Did some digging here:
Need to familiarize myself with MessageViewController codebase to make sense of the stack trace 😕
Quick fix would be if the tap event that accepts the autocorrect could be filtered and ignored
Sent with GitHawk
@SD10 can you post the stack trace? Added you as a collab to that codebase too.
Good (creating a mention without any text highlighted for replacement):
Bad (creating a mention when text is highlighted for replacement):
You can see that a lot goes on after item 22 in the bad stack. At the time of 22 the mention is created properly. Essentially, textView(_:shouldChangeTextIn:replacementText:)
gets called too many times after creating the mention. Can drill more on the weekend.
I think I patched this in Slacks TVC where I temporarily disable and re enable autocorrect when replacing text. Might have to do that here.
Sent with GitHawk
temporarily disable and re enable autocorrect when replacing text.
That could be rough. IIRC modifying the autocorrectType
while a UITextView
is the first responder has no effect. Resigning & reactivating the responder status while replacing text is kind of gross from a UX standpoint 😕
I also can't replicate this bug when using the @
symbol directly from the keyboard. That's likely why this appeared after #1507.
It seems like if you use @
from the keyboard, no autocorrect highlighting occurs until the next space (which is the functionality we want). It's as if Apple has solved this internally for special characters.
@rnystrom Are the changes I made to MessageViewController present in GitHawk yet? Noticing a new problem and have a different solution 😭😭I'm getting a bunch of single character spaces and punctuation highlighted with autocomplete attributes
Sent with GitHawk
@SD10 not yet, have to pod update
that dependency. I can hold off tho!
Sent with GitHawk
Looks to be unrelated to my changes then 🙄. Happens after any autocorrected word once there is an existing mention. Note: Bug does not show up on simulator.
Sent with GitHawk
cc @nathantannar4
Just making you aware of this issue. I will look into it more this weekend
If a word is highlighted for a suggested replacement when selecting a user from the menu to create a mention. The wrong text is created.
Moya/Moya#632
Step 1: Type @fb Step 2: The “fb” portion will be highlighted for replacement Step 3: Select user
@fbeeper
Step 4: The result is a mention forbeeper
Bug Report Dump (Auto-generated)