You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Console error when clicking 'Fix Errors' for State select input #12989
Version Number: 1.2.31-2 Reproducible in staging?: Yes Reproducible in production?: Yes Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL: Issue reported by: Slack conversation:
Form stores a reference of all input elements in inputRefs. When the fix the errors button is pressed it execute the focus method on the reference element.
@Gonals I missed that linked PR, sorry for that. I believe after the PR clicking on the button, it will do nothing. If you go ahead with my proposal, It will focus the internal select element, and pressing Space will open the select options, and pressing Enter will submit the form. Thanks!
RNPickerSelect is an external component, though, and since this PR will take us to the right element anyways, I think it is fine to just avoid the console error here.
This issue has not been updated in over 15 days. @Gonals, @miljakljajic eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
FYI, this PR hid the problem with #15290, as we no longer were attempting to call focus on a component that did not have that method, instead of fixing the fact that there was no focus
Activity
melvin-bot commentedon Nov 24, 2022
Triggered auto assignment to @miljakljajic (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.Gonals commentedon Nov 24, 2022
Similar-ish to this one, but different underlying issue and reproducible in Staging/Prod
miljakljajic commentedon Nov 24, 2022
I was able to reproduce this:
Could this be worked on by an external contributor?
mdneyazahmad commentedon Nov 25, 2022
Proposal
refis not passed properly in https://github.com/Expensify/react-native-picker-select/blob/7f09b2c15ffae320d769788f75bdf8948714bb10/src/index.js#L8Form stores a reference of all input elements in
inputRefs. When thefix the errorsbutton is pressed it execute thefocusmethod on the reference element.App/src/components/Form.js
Lines 262 to 266 in dd37575
The reference element here does not reference the
selectelement, and there does not existfocusmethod. Therefore the issue appears inconsole.App/src/components/Picker/index.js
Lines 177 to 182 in dd37575
Solution
Forward ref in
RNPickerSelectcomponent.https://github.com/Expensify/react-native-picker-select/blob/7f09b2c15ffae320d769788f75bdf8948714bb10/src/index.js
https://github.com/Expensify/react-native-picker-select/blob/7f09b2c15ffae320d769788f75bdf8948714bb10/src/index.js#L541
+ ref={this.props.innerRef}Gonals commentedon Nov 25, 2022
Ah, @miljakljajic, @mdneyazahmad , I linked the fix PR yesterday, so this doesn't need to be worked on
mdneyazahmad commentedon Nov 25, 2022
@Gonals I missed that linked PR, sorry for that. I believe after the PR clicking on the button, it will do nothing. If you go ahead with my proposal, It will focus the internal select element, and pressing Space will open the select options, and pressing Enter will submit the form. Thanks!
Gonals commentedon Nov 28, 2022
RNPickerSelect is an external component, though, and since this PR will take us to the right element anyways, I think it is fine to just avoid the console error here.
melvin-bot commentedon Dec 9, 2022
@Gonals, @miljakljajic Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Dec 13, 2022
@Gonals, @miljakljajic 10 days overdue. Is anyone even seeing these? Hello?
melvin-bot commentedon Dec 15, 2022
@Gonals, @miljakljajic 12 days overdue now... This issue's end is nigh!
melvin-bot commentedon Dec 19, 2022
This issue has not been updated in over 14 days. @Gonals, @miljakljajic eroding to Weekly issue.
melvin-bot commentedon Jan 12, 2023
This issue has not been updated in over 15 days. @Gonals, @miljakljajic eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
miljakljajic commentedon Jan 18, 2023
Do we need to keep this open? Is there anything left to be done?
alex-mechler commentedon Mar 6, 2023
FYI, this PR hid the problem with #15290, as we no longer were attempting to call
focuson a component that did not have that method, instead of fixing the fact that there was nofocus