Unable to enter text in TextField - SwiftUI preview

I'm trying out Xcode 12 (beta) and encountered an issue with TextField when viewing it in a live Preview.

Although the view is interactive (scrolling vertically seems to be OK) and a cursor appears in the TextField view when it is clicked on, keyboard input is ignored.

The same code works as expected in Xcode 11.5. Simulator in both 11.5 and 12 exhibits expected behaviour.

Is this a bug? I know there is an issue with interactivity in Preview with multiple views inside PreviewProvider but I'd assumed this is if you'd added multiple Views to the same body of this struct.


the same problem M1 Macbook Pro

The same issue. Xcode 13.2.1 (13C100)

Me too, Xcode 13.2.1. I agree with an early poster that it is not encouraging when a basic function of the preview is completely inoperative, and the bug has been known and remains unfixed a year after it was first reported.

Agreed this is disappointing on Apple’s part.

Meantime, try deleting Derived Data for the project, and quitting & restarting Xcode.

Hmm, here to report this was working flawlessly for me on Xcode 14.3, probably couple dozen times, until just now it stopped working all of a sudden.

Same here, in Xcode 15 beta 1.

Still Not Working XCODE 15.2

Strange, this recently just started happening to me out of nowhere.

I have struct in xcode 15.2 . I have unable to input in textfield in Live preview Please resolved as soon possible.

Randomly started to happen to me, Xcode Version 16.0 (16A242d) MacBook Pro M3 Pro

The same issue in Version 16.0 (16A242d).

Unable to enter text in TextField - SwiftUI preview
 
 
Q