Bug? Can't type in MobileTextField until I press the (X) icon

This is such a weird bug. It only happens on a real iOS device, not the simulator.

When I click into a blank MobileTextField to edit it, the cursor appears to the left as expected. A small circular “X” icon appears on the right.

I can’t type into the field until I press the X. Trying to type does nothing. Once I press the X, then I can type.

It seems to only happen if the MobileTextField starts off blank.

My testers pointed this out to me first since it’s only on real devices. Based on when their feedback began, I feel like it coincided with Xojo 2026 release but I’m not positive.

Has anyone else experienced this? Any workarounds?

I’ve found a (very annoying) workaround.

Public Sub removeClearButton(tf as MobileTextField, mode as integer)
Declare Function sel_registerName Lib “/usr/lib/libobjc.A.dylib” (name As CString) As Ptr
Declare Sub objc_msgSend_setInt Lib “/usr/lib/libobjc.A.dylib” Alias “objc_msgSend” (obj As Ptr, sel As Ptr, value As Integer)

Var h As Ptr = tf.Handle
If h = Nil Then Return

Var selSetClear As Ptr = sel_registerName(“setClearButtonMode:”)
objc_msgSend_setInt(h, selSetClear, mode)
End Sub

Then on focusreceived, remove it and put it back right away:

modClearButton.removeClearButton(me, 0)
modClearButton.removeClearButton(me, 1)

I guess I’m going to have to subclass MobileTextField, make this change so it applies to every control for the subclass, and rework every MobileTextField control in my app…. ugh.

Unless anyone has some insight into why this is happening?

I take it back. I think the “solution” was that the default text was a space. Not the above code. Still investigating.

What code do you have that sets the text in this field and in what events? For instance, changing the text in the textchanged event can cause this issue

In this particular text field, nothing. It’s just an empty search field that does not get set or do anything until you type into it.

But I have the same issue on other text fields where they get set to a blank and then you can’t type into them until you click the X.

I’m going to try to make an empty project with just a text field and see if it reproduces. If it does, I’ll submit a bug report.

My very simple demo app with just text fields on the first screen does not have this issue.

So I’ll have to see if I’m doing something differently in the main app that is potentially causing this.

In case anyone is curious: this must be something specific to my app.

I tried adding iOSDesignExtensions to my test app, and I tried other things like putting the screen into a tab bar to replicate the app with this issue, and even copied in the exact screen to the test app. None of that triggered it in the test app.

So I’m kind of stumped.