-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The number fields are really glitchy #72
Comments
Any specific approach you've wanted to integrate this? I may create a PR. |
Oh nice! Yeah that'd be good. Nothing specific, UI wise I'd want them to appear the same. The main issue is that at the moment they are Text fields with fudgy reactive validation, but that causes things to behave weirdly. Since making this app, there are far better ways now available in Swift UI to natively do what I had to do hackily at the time. A nice refactor is on the cards: https://www.hackingwithswift.com/quick-start/swiftui/how-to-format-a-textfield-for-numbers Its mainly so in the use case of say having the field filled with It needs to not be empty on start, so the validation trigger could be moved I guess. But the main thing is to just try to make them feel less finicky and more reliable with what you'd expect with something like a HTML Number field. As at the time of making this app, there wasn't a native Number field in Swift UI that only allowed numbers to be entered. |
Okay perfect, i'll try to read and look into this next week. |
Quick Question, is there a reason why the validation is called twice? once in DynamicNumberField and once in NumberField. |
It's so long ago, honestly no idea. Could be an abstraction artifact. Could be a bug! |
Description
Its been a problem since the apps inception, but as SwiftUI doesn't have a numeric only field, you have to fudge the TextField with support which is what this app has been running on.
However, this has changed somewhat since this app was first made and there are better ways to handle updates:
https://www.hackingwithswift.com/quick-start/swiftui/how-to-format-a-textfield-for-numbers
I need to review the fields and make support better as at the moment, they're glitchy as anything. Especially when trying to change the field from something like
1
to5
seconds as you can never remove the1
as it won't let you empty the field.Version
latest
Steps to Reproduce
See description.
Screenshots
No response
Device
Any Mac
Operating System
macOS 13.x
Additional Context
No response
The text was updated successfully, but these errors were encountered: