-
Notifications
You must be signed in to change notification settings - Fork 115
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
POS: Dismiss Cash and Email view keyboard before the view disappears #14902
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely, dropped a comment on a bit I'm not sure I fully understand, as seems we're not using it.
🚢
func focused(_ focusBinding: FocusState<Bool>.Binding) -> FormattableAmountTextField { | ||
var copy = self | ||
copy.externalFocusBinding = focusBinding | ||
return copy | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand the usage of computed focusAmountInput
with re-declaring focused(...)
and differentiating internal from external focus input here (so the commit 990053d ) 🤔
We seem to use the default SwiftUI's focused<Value>(_ binding: FocusState<Value>.Binding, ...
and commenting this out seems to work just fine, so we could remove these as well and be enough to set isTextFieldFocused = false
as needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, you're right! 💯
I didn't think the default .focused
would work when passing .focused
through outside and within FormattableAmountTextField
at the same time but I was wrong.
bdb9a8d
to
8734617
Compare
Merge after #14854
Description
In Cash and Email Receipt views the keyboard would disappear after the view disappears without animation which looked like a glitch.
A solution is to manually dismiss focus of keyboard when back button is tapped or when the submission is succesful.
Steps to reproduce
POS
.acceptCashForPointOfSale
flag totrue
Regression
Testing information
Screenshots
ScreenRecording_01-17-2025.11-13-43_1.MP4
ScreenRecording_01-17-2025.11-06-39_1.MP4
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: