-
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/15086: Screen is flashing when changing focus between edit input #15201
Fix/15086: Screen is flashing when changing focus between edit input #15201
Conversation
@thienlnam @mananjadhav 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] |
…n only be triggered when close edit message
…n only be triggered when close edit message
Hi @mananjadhav @thienlnam, Please help to review this PR. Thanks |
On my list today. Focused on email getOptions task for the time being. |
@@ -244,12 +247,18 @@ class ReportActionItemMessageEdit extends React.Component { | |||
toggleReportActionComposeView(false, this.props.isSmallScreenWidth); | |||
}} | |||
onBlur={(event) => { | |||
const relatedTargetId = lodashGet(event, 'nativeEvent.relatedTarget.id'); |
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.
nab, but I don't see why we had to change this.
Reviewer Checklist
Screenshots/VideosWebweb-edit-message-screen-flicker.movMobile Web - Chromemweb-chrome-edit-message-screen-flicker.movMobile Web - Safarimweb-safari-edit-message-screen-flicker.movDesktopdesktop-edit-message-screen-flicker.moviOSios-message-screen-flicker.movAndroidandroid-edit-message-screen-flicker.mov |
@thienlnam All yours. @tienifr Quick suggestion, I saw last few commits had the same commit message. I would recommend writing meaningful messages that explains the context of the commit. Thanks for the quick PR on this one. Appreciate it. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.2.74-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.2.74-0 🚀
|
if (this.messageEditInput === relatedTargetId) { | ||
return; | ||
} | ||
openReportActionComposeViewWhenClosingMessageEdit(this.props.isSmallScreenWidth); |
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.
Why do we still need to delay opening the main composer? Isn't the relatedTargetId
check enough?
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.
I also think the same.
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 see that relatedTargetId
only exists for web. But we are delaying opening the main composer for every single blur event (including those that are not related to the edit input).
const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => { | ||
toggleReportActionComposeView(true, isSmallScreenWidth); | ||
keyboardDidHideListener.remove(); | ||
}); |
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.
This caused a regression (case 1). If we focus on message A then switch to message B then message A will be blurred and we register the keyboardDidHide callback. Now if we press the back button to hide the keyboard (while message B is still focused) the main composer will show up.
What we had to do is to remove that callback as soon as a new message is focused.
Details
When we move from 1 edit message input to another, the toggleReportActionComposeView is called, causing the ReportActionCompose to become visible, pushing the view upward and causing the glitch. We should only call toggleReportActionComposeView when the keyboard is completely hidden and this PR does that
Fixed Issues
$ #15086
$ #15086 (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.Screenshots/Videos
Web
Screen.Recording.2023-02-16.at.16.55.53.mp4
Mobile Web - Chrome
330453922_6101100966580019_8678114187605412338_n.1.mp4
Mobile Web - Safari
Screen.Recording.2023-02-16.at.16.56.51.mp4
Desktop
Screen.Recording.2023-02-16.at.17.00.53.mp4
iOS
Screen.Recording.2023-02-16.at.17.06.11.1.mp4
Android
Screen.Recording.2023-02-16.at.17.21.23.mp4