-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS][Barcodes] Disable scanning when the support view is open #15972
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
[Woo POS][Barcodes] Disable scanning when the support view is open #15972
Conversation
POSSheet - Wraps default SwiftUI .sheet() modifiers to support sheet presentation detection within POS. Sheet presentation can be detected via POSSheetManager.isPresented.
Generated by 🚫 Danger |
|
|
jaclync
left a comment
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 well! Had to reset my scanner to factory settings to complete the barcode scanning onboarding, but other than that everything works as expected, not seeing unexpected scanned from input in support form and other forms.
| .sheet(isPresented: $showSupport) { | ||
| .posSheet(isPresented: $showSupport) { | ||
| supportForm | ||
| .interactiveDismissDisabled(true) |
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.
unrelated to this PR, as it happens in trunk as well: I noticed that after confirming the email alert on top of the support form, there was no obvious way to exit the form. The "Done" CTA in the navigation bar is actually the CTA to dismiss the form after checking the code, but I thought it's to submit the form as a user. Since interactive dismissal is disabled, maybe we can rename this "Done" to some dismissing action like "Cancel" and place it in the leading edge.
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.
Great observation. It's an easy change, I will do it and merge.
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.

WOOMOB-945
Description
Scanning is still detected when the support view or any other SwiftUI
.sheetis opened in POS. The largest issue is with coupons and support sheets, which detect text input with an external keyboard (or amacOSkeyboard when testing on a simulator).Solution
We already disable scanning when posModals are opened with
modalManager.isPresentedcheck withinItemListView. However, I haven't thought about doing the same forSwiftUIsheets.However, we cannot keep using a native
.sheetmodifier and cleanly detect if a sheet is presented or not. I tried looking for such solutions unsuccessfully. Therefore, I decided to introduce a.posSheetwrapper which uses the same system asposModalto enablesheetManager.isPresentedchecks when needed.This implementation relies on future POS development to use
posSheetinstead ofsheetfor barcode scanning prevention functionality to work. Therefore, there's always a chance some new sheet will be presented without preventing barcode scanning detection.Steps to reproduce
Testing information
Tested on iPad Air 20.6 simulator
RELEASE-NOTES.txtif necessary.