marinofelipe / CurrencyText

Currency text field formatter available for UIKit and SwiftUI 💶✏️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect cursor position when editing

marinofelipe opened this issue · comments

Description

As reported:

The starting cursor positioning code hasn't been working for us when we fill the text field with a formatted currency string so the user can edit it. Under this condition, when the user taps the field the initial cursor position is forced to be somewhere in the middle of the string. So something similar to this "$123,|456".

Setup to reproduce the issue:
$0.minValue = 1
$0.currency = .dollar
$0.locale = CurrencyLocale.englishUnitedStates
$0.maxValue = 100000000
Text entered in the filed: 12345678

Dependecies / References

Reported by @CGKarnlund on #59

This is now closed. This was related to changes I had made to build and run in a Swift 4.2 project on Xcode 10.1.

@CGKarnlund I was able to simulate it in Xcode 11 / Swift 5. It happens when I copy and paste 12345678 to the field with reported configurations.

Closing this since it's not relevant anymore.