Skip to content

Commit ba6688b

Browse files
author
Ignacio Romero Zurbuchen
committed
Merge pull request slackhq#188 from slackhq/brady-fixed-japanese-keyboards
Fixes autocompletion on Japanese keyboards
2 parents ff6c1e7 + 8aa9dee commit ba6688b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Source/Classes/SLKTextView.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,15 @@ - (void)setTypingSuggestionEnabled:(BOOL)enabled
362362
return;
363363
}
364364

365+
// Toggling autocorrect on Japanese keyboards breaks autocompletion.
366+
// If you try typing "@" on a Japanese keyboard toggling the autocomplete causes iOS
367+
// to set the textView's text to an empty string.
368+
// My thought is that this is caused by the same mechanism that forces autocorrection
369+
// to be committed when refreshing the first responder.
370+
if ([self.textInputMode.primaryLanguage isEqualToString:@"ja-JP"]) {
371+
return;
372+
}
373+
365374
self.autocorrectionType = enabled ? UITextAutocorrectionTypeDefault : UITextAutocorrectionTypeNo;
366375
self.spellCheckingType = enabled ? UITextSpellCheckingTypeDefault : UITextSpellCheckingTypeNo;
367376

0 commit comments

Comments
 (0)