-
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
[$500] Task - Title field is not focused when going back #30366
Comments
Job added to Upwork: https://www.upwork.com/jobs/~0167a5caffbbaa5a60 |
Triggered auto assignment to @sophiepintoraetz ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The "Title" field on task creation is not focused on navigating back What is the root cause of that problem?For handling the Task's Title field, we use a custom hook: https://github.com/Expensify/App/blob/c3a6b429569474d2e883fb83de802508a85f727a/src/hooks/useAutoFocusInput.js This hook is intended to handle the Input field's state and auto-focus on navigation, when the screen is focused. It uses the following App/src/hooks/useAutoFocusInput.js Lines 19 to 32 in c3a6b42
Here, we set the As a result, next time the screen is re-focused, this hook is not triggered, as the isScreenTransitionEnded was not changed (true -> true), and the input is already initialized: useEffect(() => {
if (!isScreenTransitionEnded || !isInputInitialized || !inputRef.current) {
return;
}
inputRef.current.focus();
}, [isScreenTransitionEnded, isInputInitialized]); What changes do you think we should make in order to solve the problem?Along with clearing the useFocusEffect(
useCallback(() => {
focusTimeoutRef.current = setTimeout(() => {
setIsScreenTransitionEnded(true);
}, CONST.ANIMATED_TRANSITION);
return () => {
+ setIsScreenTransitionEnded(false);
if (!focusTimeoutRef.current) {
return;
}
clearTimeout(focusTimeoutRef.current);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []),
); Result:Screen.Recording.2023-10-25.at.19.35.31.mp4What alternative solutions did you explore? (Optional) |
@paultsimura Was writing the same proposal but you bumped first! Supafast 💨 |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
ResultScreencast.from.26-10-2023.09.46.35.webm |
Reviewing now |
@paultsimura 's proposal here #30366 (comment) looks good and works well. Other proposals are similar. 🎀 👀 🎀 |
Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@abdulrahuman5196 my proposal mentioned the solution using InteractionManager.runAfterInteractions, that will fix the issue: delay when refocusing and remove using setTimeout, because i think that using setTimeout is workaround, please help check. cc @nkuoch |
@DylanDylann Your proposal is only removing the use of setTimeout with runAfterInteractions, whereas the core issue to fix setIsScreenTransitionEnded(false) remains same. And furthermore runAfterInteractions are not expected to work completely with web, as mentioned in the doc - https://reactnative.dev/docs/interactionmanager |
@nkuoch Gentle ping on this #30366 (comment) |
@abdulrahuman5196 thanks for review it |
@abdulrahuman5196 if we should not use interactionManager, so this problem will be fixed in this one #29009 (comment) |
@sophiepintoraetz Kindly put this issue on hold for #30675? The same is fix being made at a different place. |
Updated! |
@abdulrahuman5196 the PR we were holding for is now merged. The issue is not reproducible anymore on the latest |
taking off hold. |
@abdulrahuman5196 - do you mind confirming if the issue still stands? If not, then I think payments are: |
@sophiepintoraetz why 500$ for me? Any mistake here? |
@DylanDylann - sorry, I'm getting my issues wired - we're all set here! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.3.90.2
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
Expensify/Expensify Issue URL:
Issue reported by: @daveSeife
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1698156938953799
Action Performed:
The title field is not focused when going back
Expected Result:
The title field is focused when going back
Actual Result:
The title field is not focused when going back
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
XRecorder_24102023_175148.mp4
Android: mWeb Chrome
XRecorder_24102023_175108.mp4
iOS: Native
t8Titlefocus.iosApp.mp4
iOS: mWeb Safari
t8Titlefocus.iosSafari.mp4
MacOS: Chrome / Safari
t8Titlefocus.MacChrome.mp4
MacOS: Desktop
t8Titlefocus.Desktop.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: