mikeCenters / NumberTextField

A powerful SwiftUI text field that handles formatting and retaining number values.
MIT License
18 stars 1 forks source link

textFieldDidBeginEditing and textFieldDidChange called twice #2

Open TorianKel opened 5 months ago

TorianKel commented 5 months ago

Getting rid of UIOpenTextField fixes this issue

mikeCenters commented 5 months ago

Getting rid of UIOpenTextField fixes this issue

UIOpenTextField is used to publish the cursor position.

I'm not saying you're wrong or anything, just stating the purpose. I haven't updated this in forever.

TorianKel commented 5 months ago

Sorry, I was mistaken. I also removed the 'setup' function in the Coordinator, so the mentioned events started being called only once. However, textFieldDidChange stopped being called at all, as I noticed later. So I left .addTarget only for this event, and it seems fine.