-
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
Fix: 16098 main composer is focused again when user enters key if the emoji picker is not open #17649
Conversation
@PauloGasparSv @rushatgabhane One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Can we update this PR's title to something that summarizes what's being done in it? |
@rushatgabhane @PauloGasparSv any updates? |
replying to - #16098 (comment) I don't think we should implement this feature. It's a UX polish but is it even required? |
Sorry for the delay here guys!
I agree and I don't think we shouldn't implement this again at the moment : / But I don't think we should dismiss this feature just yet! I'll bring this discussion over to slack in #expensify-open-source so more people can chime in and give their opinion on whether we should try to implement this again or not. |
we can close this PR, thank you! |
Hey @rushatgabhane I'm confused! Aren't we going to test this? |
@tienifr would you mind fixing the conflicts? bump @rushatgabhane for a review here please |
@tienifr can you fix the new conflict? Also, what do you and @rushatgabhane think of using the following test steps? I tried to add all the regressions we had so far as tests here: Typing should focus on the composer
Typing in other inputs and modals(Coming from here)
The composer Emoji Picker(Coming from here)
Copying&Pasting - Web & Desktop only
|
* @param {String} text | ||
*/ | ||
replaceSelectionWithInput(text) { | ||
const newComment = this.comment.slice(0, this.state.selection.start) + text + this.comment.slice(this.state.selection.end, this.comment.length); |
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 think we could call ComposerUtils.insertText
here right?
@tienifr can you check why the following is happening after the workspaces page is accessed? The modal is still opened but the input is going to the composer. Screen.Recording.2023-05-22.at.14.29.02.mov |
Tests look good! They capture all the regressions we've faced |
After checking our code, I found out that In App/src/components/Modal/BaseModal.js Lines 69 to 77 in 6946beb
We always call Modal.setModalVisibility(false); even when we press back button (WS -> Setting) (this should not be called). That makes our checks false
It can be out of this scope, so I suggest to create another PR to fix this bug first. My solution: We should not call Modal.setModalVisibility(false) when we click back button Change this line App/src/components/Modal/BaseModal.js Line 112 in 6946beb
to
and update these lines App/src/components/Modal/BaseModal.js Lines 70 to 72 in 6946beb
to
Please tell me what you think @PauloGasparSv @rushatgabhane |
@tienifr let's try that but I think it'd cause regressions if other components are assuming the visibility to be false when back is pressed. |
@rushatgabhane should we fix the visibility bug in other PR because it's not related to this PR? |
I think we should try here as @rushatgabhane said! @tienifr I also think we should treat this as related to the bug since we'll introduce the problem in this P.R. : / Can we attempt that fix you proposed? |
@rushatgabhane @PauloGasparSv I've updated my PR. I found out that we can lean on
Additional solution We can use the following code in Navigation.js
I tested many cases and there's no regression, but we should double check. Thanks |
I don't think that's reliable enough. Because it's the index of focused route in the routes array. |
@rushatgabhane After checking our App, I can't find any cases that the index === 0 but the modal is still open. Can you help find this case? Or do you have any suggestions? Thanks so much |
thing is, in future it could. I think it's a workaround for finding if a modal is open. |
I spend much time, but I can't find the best solution, it can cause regression some where. Can you give me any advices? Thanks @rushatgabhane @PauloGasparSv |
Okayy, I'll try to work on this today. |
Will investigate tomorrow : ) |
I'll actually have time for this today, couldn't focus on this at all this week. @rushatgabhane do you have any updates on your side? |
Bump @rushatgabhane |
Hi, sorry I had looked into this but didn't find anything. I was out sick and I can't prioritize it right now. |
Sorry for the delay and sorry to hear that @rushatgabhane, hope you are feeling better! Should I re-assign a new C+ member to this issue/P.R.? |
@PauloGasparSv yes please could you reassign it to another c+ |
@tienifr Please resolve conflicts. |
Let's close this PR @tienifr thanks! |
Details
We should automatically focus on the Composer if we press on regular characters like a, b, c, d, ... (not non-character keys like Enter, Shift) when we're not typing on any input or textarea.
Fixed Issues
$ #16098
PROPOSAL: #16098 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-04-19.at.17.49.13.mp4
Mobile Web - Chrome
RPReplay_Final1680890370.mp4
Mobile Web - Safari
RPReplay_Final1680890255.mp4
Desktop
Screen.Recording.2023-04-08.at.01.07.15.mov
iOS
Screen-Recording-2023-04-08-at-01.06.13.mp4
Android
Screen.Recording.2023-04-08.at.01.27.23.mov