-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD #11795][$1000] No transition animation on timezone selector #24139
Comments
Triggered auto assignment to @bfitzexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Proposal from @chiragxaroraPlease re-state the problem that we are trying to solve in this issue.no transition anmation on timezone selector What is the root cause of that problem?Root cause of the issue is focusing logic in our App/src/components/SelectionListRadio/BaseSelectionListRadio.js Lines 173 to 188 in 52b8ddc
Currently the text input is focused conditionally based on shouldDelayFocus prop and we have not used that prop in our timezone selector, so it instantly focuses the input leading to no animationApp/src/pages/settings/Profile/TimezoneSelectPage.js Lines 119 to 126 in 52b8ddc
What changes do you think we should make in order to solve the problem?We need to alter the focusing logic in that page and we shall wait for the transitions to end before we focus. For this, we need to wrap our component in ScreenWrapper and then we can use the const [didTrasitionEnd, setDidTransitionEnd] = useState(false);
onEntryTransitionEnd={() => setDidTransitionEnd(true)} and replace this line
with this if(didTrasitionEnd) textInputRef.current.focus(); Resultshttps://github.com/chiragxarora/pdf-download/assets/54641656/8f21b0f8-d3c4-45d8-ba00-2417015fe04d |
ProposalPlease re-state the problem that we are trying to solve in this issue.No transition animation on timezone selector What is the root cause of that problem?App/src/components/SelectionListRadio/BaseSelectionListRadio.js Lines 173 to 180 in 52b8ddc
Without shouldDelayFocus props, BaseSelectionListRadio component with TextInput element tries to focus on TextInput when its mounted. Focusing on Text in the beginning prevents transition of ScreenWrapper component.
What changes do you think we should make in order to solve the problem?Pass <SelectionListRadio
shouldDelayFocus
...
/> This is happening on Pronouns setting page, too. we need to pass What alternative solutions did you explore? (Optional)N/A |
Job added to Upwork: https://www.upwork.com/jobs/~0177d92223610217d2 |
Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.No transition animation on timezone selector What is the root cause of that problem?RCA for this issue pretty straight forwarded and already observed at many places. Same here in the timezone select page we have an input which is getting autoFocused which causing the cluttered/no-animation for component. Since we're setting focus to the input before completing the rendering of modal(Transition) this issue happening. What changes do you think we should make in order to solve the problem?I feel this proposal is tricky and long but I feel this should be done like this only. Steps to solve this. Step 1:
ref to BaseSelectionListRadio component which is functional component.
But we're not using Step 2: Inside the hook we should have a function maybe like useImperativeHandlers(props.forwardedRef, () => ({
focusInput: () =>{
textInputRef.current.focus()
}
})) Step 3: Step 4:
if (shouldShowTextInput && props.autoFocus) {
// Run the focus logic here.
// we also have to add `props.autoFocus` to `useEffect` dependency.
} which results makes the animation to work perfectly when this false passed here
<SelectionListRadio
{...props}
autoFocus={false}
/> Step 5:
ref={(el) => this.selectionListRef.current = ref} call the onEntryTransitionEnd={() => {
this.selectionListRef.current && this.selectionListRef.current.focusInput()
}} What alternative solutions did you explore? (Optional)Simply pass the Or if we feel all this is complex logic which might cause regressions later down the line we could simply do conditional rendering inside We could simple use
ResultKapture.2023-08-05.at.01.57.49.mp4 |
Hi all! Thank you all for your proposals!
|
here @robertKozik App/src/components/StatePicker/StateSelectorModal.js Lines 67 to 82 in 8639fb6
|
same with year picker, country picker |
here's the result video, it didn't render properly in the GH comment above Screen.Recording.2023-08-01.at.3.21.14.PM.mov |
did you have a look @robertKozik ? |
@robertKozik handling conditional logic inside the base component doesn't make sense to me. I feel since we're having a |
I have mixed thoughts for this. The @chiragxarora approach makes sense for me, as it's quite simple and doing it's job. But you pointed out good counter argument. It's better to keep base component with no "outside" logic @b4s36t4 did you check these places which @chiragxarora pointed out - with timezone selector as modal? Does your solution work for them too? |
@robertKozik I think the places which @chiragxarora mentioned are component not screens. |
my proposal is making use of the ref only, its focusing using the input ref, by making sure the transition has ended using onEntryTransitionEnd prop, which is what we have used everywhere in the app. What's foreign/outside logic in this? Could you explain me @b4s36t4 @robertKozik I'm not sure if you've seen @b4s36t4 's proposal or not but it's the one which brings new foreign hooks
This is what I am doing |
please explain the drawbacks of my proposal @b4s36t4 @robertKozik |
@chiragxarora there are no drawbacks with your issue. the solution which is proposed is having outside logic which is the state you'll be introducing The main thing I'm worried is passing a state which is derived from a screen to the base component is not what the solution should do. I feel we have Also the modals which you listed above uses Also it doesn't have to be Decision is upto @robertKozik. I feel we don't touch the ones which are working fine with |
📣 @chiragxarora 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
PR #25414 is ready for review @robertKozik |
Based on Slack, I believe we have decided to close out this PR - but not the issue - and it will be fixed in the refactor of this component. We should still pay out @robertKozik and @chiragxarora as if the PR went through. Does that sound right to everyone? |
@dangrous Sure! I'd like to remind that I'm from Software Mansion (an expert agency), so I'm not eligible for payment. |
sounds good to me @dangrous |
Okay cool, I'll put this on hold for #22622 for now, and we can test and confirm and pay once that's all complete |
#25894 I think the same approach I suggested being followed here to focus the input instead of using passing and it's accepted too :) |
Also that PR also solves this issue. |
Thanks @b4s36t4! I've called out in that issue that it'll likely get solved by the SelectionList refactor just like this one. |
Still on hold |
@dangrous I believe SelectionList refactor is complete, isn't it? |
not according to that issue, but I can confirm. I believe they were splitting it up into three phases, and this issue would only be solved by phase 2. @thiagobrez do you mind confirming when you have a moment? Thank you! (Re this Slack conversation). |
Oh, sweet! @robertKozik do you mind testing this again to see if we can close out? |
bump for testing @robertKozik when you have time! Should be quick - thanks |
Sure! Missed that one, on it 👀 |
Can confirm, transition is present and issue is fixed 🚀 |
Sweet! So I think we just need payment for @chiragxarora, as both reporter and contributor - even though the PR was not used, we agreed to pay as if it had. Does that seem right to everyone? |
@bfitzexpensify do you think you can sort out payment for @chiragxarora this week? Thanks! |
All sorted! |
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:
Expected Result:
there should be a transition animation while it opens
Actual Result:
no transition animation happens
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.50-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-08-01.at.3.03.12.PM.mov
Recording.1442.mp4
Expensify/Expensify Issue URL:
Issue reported by: @chiragxarora
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690882305493399
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: