Githawk: Suggested replacement text breaks autocomplete

Created on 13 Feb 2018  ยท  10Comments  ยท  Source: GitHawkApp/GitHawk

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 for beeper


Bug Report Dump (Auto-generated)

Version 1.18.0 (1518216007)
Device: iPhone 7 (iOS 11.0.2)
TestFlight: false

๐Ÿ› bug

All 10 comments

Did some digging here:

  • Seems to only clip the first two characters (regardless of user or suggested word)
  • Reason it happens is because the tap for selecting a user from the mention list also causes the suggested word to be accepted

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):
screen shot 2018-02-13 at 6 46 01 am

Bad (creating a mention when text is highlighted for replacement):
screen shot 2018-02-13 at 6 47 33 am

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

GitHawk Upload by SD10

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnystrom picture rnystrom  ยท  3Comments

viktorgardart picture viktorgardart  ยท  3Comments

rizwankce picture rizwankce  ยท  3Comments

rnystrom picture rnystrom  ยท  3Comments

BasThomas picture BasThomas  ยท  3Comments