Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix - mWeb auto focus on reply in thread #37929
Fix - mWeb auto focus on reply in thread #37929
Changes from 8 commits
5e7121a
1450307
b7f306e
d7abc9d
f69df2a
69e6022
0d37448
c51602f
9e2c1d1
78d815b
1b9163c
aa4fe30
4c34830
31db23e
297cd03
2bf777e
822cf62
c27d74e
4a40236
335b5fa
6fd4517
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
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.
Nope. What we are trying to avoid for main composer is overriding of the focus callback;
onComposerFocus
is callback assigner so we should avoid overriding ofmainComposerFocusCallback
byfocusCallback
so whenisReportActionCompose
is true we reset it tonull
.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.
I still don't get the reasoning behind this. Why can't we just return early in the callback if
isReportActionCompose
istrue
?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.
What we want to achieve is when the focus is called from reply in thread we want to focus the compose in the newly created thread and we can do that via
mainComposerFocusCallback
set hereApp/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 611 to 617 in 822cf62
But mainComposerFocusCallback are only called when
focusCallback
is not set.App/src/libs/ReportActionComposeFocusManager.ts
Lines 38 to 43 in 822cf62
So here what we want is to reset
focusCallback
to null so that our mainComposerFocusCallback will be called. But early returning, as U suggest, means we leave (without reseting) what was already set onfocusCallback
therefore ourmainComposerFocusCallback
will not be called.