JUCE mobile keyboard shouldn't have autocorrect

I didn’t try too much but from my experience juce::TextEditors don’t cope well with auto-correct/completion.

Wouldn’t it be better to have JUCE explicitly ask for no-autocorrect?

here’s a patch from what I saw at least:

diff --git a/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java b/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java
index 9a43aa5ec..031e3d745 100644
--- a/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java
+++ b/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java
@@ -358,7 +358,7 @@ public final class ComponentPeerView extends ViewGroup
         outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
         outAttrs.label = "";
         outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
-        outAttrs.inputType = InputType.TYPE_NULL;
+        outAttrs.inputType = InputType.TYPE_NULL | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
 
         return new BaseInputConnection (this, false);
     }
diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
index e15f423b2..e1ef3a7a9 100644
--- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
+++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
@@ -980,6 +980,7 @@ static UIKeyboardType getUIKeyboardType (TextInputTarget::VirtualKeyboardType ty
 
 void UIViewComponentPeer::updateHiddenTextContent (TextInputTarget* target)
 {
+    view->hiddenTextView.autocorrectionType = UITextAutocorrectionTypeNo;
     view->hiddenTextView.keyboardType = getUIKeyboardType (target->getKeyboardType());
     view->hiddenTextView.text = juceStringToNS (target->getTextInRange (Range<int> (0, target->getHighlightedRegion().getStart())));
     view->hiddenTextView.selectedRange = NSMakeRange ((NSUInteger) target->getHighlightedRegion().getStart(), 0);
3 Likes