-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[$1000] VBA - Cannot select the checkbox when a valid field is being focused entering bank account manually #13211
Comments
Triggered auto assignment to @trjExpensify ( |
ProposalThere is no easy fix to it because SolutionsWe can: diff --git a/src/components/CheckboxWithLabel.js b/src/components/CheckboxWithLabel.js
index 96f85fb25..e75d81dd6 100644
--- a/src/components/CheckboxWithLabel.js
+++ b/src/components/CheckboxWithLabel.js
@@ -91,14 +91,14 @@ class CheckboxWithLabel extends React.Component {
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Checkbox
isChecked={this.isChecked}
- onPress={this.toggleCheckbox}
+ onMouseDown={this.toggleCheckbox}
label={this.props.label}
hasError={Boolean(this.props.errorText)}
forwardedRef={this.props.forwardedRef}
/>
<TouchableOpacity
focusable={false}
- onPress={this.toggleCheckbox}
+ onMouseDown={this.toggleCheckbox}
style={[
styles.ml3,
styles.pr2,
b. Add a condition inside the diff --git a/src/components/Form.js b/src/components/Form.js
index 34199bd4f..e84d95521 100644
--- a/src/components/Form.js
+++ b/src/components/Form.js
@@ -217,9 +217,11 @@ class Form extends React.Component {
ref: node => this.inputRefs[inputID] = node,
value: this.state.inputValues[inputID],
errorText: this.state.errors[inputID] || fieldErrorMessage,
- onBlur: () => {
+ onBlur: (e) => {
this.setTouchedInput(inputID);
- this.validate(this.state.inputValues);
+ if (e.nativeEvent.relatedTarget.role !== 'checkbox') {
+ this.validate(this.state.inputValues);
+ }
},
onInputChange: (value, key) => {
const inputKey = key || inputID;
Let me know which approach makes more sense and I'll implement that one. |
I am casting a vote for "do nothing". The blur happens first and causes the layout shift. We shouldn't try to interfere with that. Our forms are design to get you to address errors and resolve them so I think this behavior would be more than tolerated (and probably unusual for anyone to actually do). |
This could be a duplicate of #12715 |
ProposalProblemEvent execution order: mousedown -> blur -> click, so the blur happens cause layout change, then click event targets to wrong component. Solutionwe can implement the behavior as ios/android is to keep focusing when click checkbox In
<CheckboxWithLabel
style={styles.mt4}
inputID="acceptedTerms"
+ onMouseDown={(event)=>{
+ event.preventDefault();
+ event.stopPropagation();
+ }}
... In App/src/components/CheckboxWithLabel.js Line 92 in 820e876
<Checkbox
isChecked={this.isChecked}
onPress={this.toggleCheckbox}
+ onMouseDown={this.props.onMouseDown}
label={this.props.label}
hasError={Boolean(this.props.errorText)}
forwardedRef={this.props.forwardedRef}
/>
<TouchableOpacity
focusable={false}
onPress={this.toggleCheckbox}
+ onMouseDown={this.props.onMouseDown}
... Screen.Recording.2022-12-01.at.17.03.01.mp4 |
I don't think it's a dupe, but similar. The fix for the ToS link is on staging and this issue with the checkbox still remains.
I tend to agree @marcaaron, though the fact it works fine on native but not Web is an inconsistency. Not sure if that wholly sways the opinion here, but if it's simple enough to remove that inconsistency, it could be worth it. |
I'm a little concerned about the proposals we've got. The mouse down solution is missing some explanation for why a "mouse down" gets fired before a "blur" but a "click" happens after. And adding checks to the blur handler to "cancel the blur" really goes against out current design. On blur the error should be shown. I don't think we really need to make exceptions to that and I think users will have a high tolerance for a small issue like this. |
Yeah, I agree on blur the error should be shown. On native, we don't blur if you interact with the checkbox on the form. Here's a vid of iOS for reference: RPReplay_Final1669913690.MP4 |
😞 |
@trjExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Coming back here. Why doesn't mobile work the same as web on this form, could we look at what explanation there is for why it isn't consistent? I think our options boil down to:
|
Huh, those are good questions. Maybe we bring this to Slack to align on the behavior? |
Yah mon, posted here. |
Discussion going on in the thread. |
The latest of where we're at on the expected behaviour from the thread is:
I have an outstanding question for @marcaaron re: platform consistency, but I believe this should be implemented consistency across web, desktop, mobile and mWeb. I'm going to add the |
Current assignee @trjExpensify is eligible for the External assigner, not assigning anyone new. |
Job added to Upwork: https://www.upwork.com/jobs/~01a77f27abe4f6fc46 |
Still held, but we have someone picking up the form validation project at large now. Woop! |
Still the same here, Melv. |
Not overdue |
Still held. |
Held |
👋 The tracking issue this was held on has been completed now. I just re-tested this issue and the checkbox is checked on first click now as expected. @muttmuure, I've removed the hold from this issue title, dropped it back to |
Taking care of this to clear it from WAQ dashboard. @hungvu193 sent you a contract here. |
@trjExpensify Thank you, I've just applied |
Settled! |
Thanks Tom! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Routing Number
is being focused and no error is showed, click oncheck box
Routing Number
and click oncheck box
Expected Result:
Checkbox should be selected and focused at the first click
Actual Result:
Checkbox is not selected when a valid field is focused for the first time
Workaround:
unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.34-1
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Recording.1030.mp4
Screen.Recording.2022-11-30.at.21.39.59.mov
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1669819241231349
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: