Wednesday, November 11, 2026
HomeiOS Developmentios - Unresponsive TextField, is that this a bug in Swift, the...

ios – Unresponsive TextField, is that this a bug in Swift, the simulator, or my code?

[ad_1]

At the moment working Xcode Model 13.4 (13F17a). Testing for iOS 15.5.

I’ve a TextEditor and a TextField on an VStack. The TextField is totally unresponsive after I run the app on the simulator. I am unable to write in it, I am unable to achieve focus, even when I power it to be enabled, nothing occurs.

Primarily based on comparable questions right here in SO and elsewhere, there was as soon as a bug that prompted this to occur a few years again, however I ponder if this is identical bug, or a bug in my code.

If I am lacking something that may be prompted this habits, might you level me to it?

This is the view:

struct NoteView: View {
    @Setting(.managedObjectContext) non-public var viewContext
    var be aware: Be aware
    @State var textual content: String = ""
    @FocusState non-public var editorIsFocused: Bool
    @State non-public var newTag: String = ""

    var physique: some View {
        VStack {
            TextEditor(textual content: $textual content).padding().font(.physique)
                .disableAutocorrection(false)
                .onAppear() {
                    DispatchQueue.essential.asyncAfter(deadline: .now() + 0.5) {
                        editorIsFocused = true
                    }
                }
                .centered($editorIsFocused)
            
            Spacer()
            Divider()
            
            TextField("Tag...", textual content: $newTag)
                  .disableAutocorrection(true)
                  .padding()
            
            Spacer()
            
        }
    }
        
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments