-
Notifications
You must be signed in to change notification settings - Fork 3k
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: Keyboard fix on attachment download #12053
Conversation
Hi @Uros787, the commit message isn't clear, it should provide some info about the change. Can you change it? |
be236bc
to
3d7d140
Compare
@thesahindia done |
src/components/AttachmentModal.js
Outdated
@@ -251,7 +251,7 @@ class AttachmentModal extends PureComponent { | |||
shouldShowBorderBottom | |||
shouldShowDownloadButton={this.props.allowDownload} | |||
onDownloadButtonPress={() => { |
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.
Let's move this to a method. Also we should add a comment to explain why we need Keyboard.dismiss()
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.
done, let me know if its okay
src/components/AttachmentModal.js
Outdated
* /** | ||
* @param {String} sourceURL | ||
*/ | ||
onDownloadButtonPress(sourceURL) { |
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.
According to the guidelines we shouldn't use a name like this.
App/contributingGuides/STYLE.md
Line 99 in 245ea00
- When you have an event handler, do not prefix it with "on" or "handle". The method should be named for what it does, not what it handles. This promotes code reuse by minimizing assumptions that a method must be called in a certain fashion (eg. only as an event handler). |
so instead we should rename it to downloadAttachment
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.
renamed.
src/components/AttachmentModal.js
Outdated
/** | ||
* Download the attachment | ||
* /** |
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.
/** | |
* Download the attachment | |
* /** | |
/** |
I believe the method name will be enough to understand what it does, so no need for a comment.
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.
removed.
src/components/AttachmentModal.js
Outdated
@@ -87,9 +87,23 @@ class AttachmentModal extends PureComponent { | |||
this.submitAndClose = this.submitAndClose.bind(this); | |||
this.closeConfirmModal = this.closeConfirmModal.bind(this); | |||
this.validateAndDisplayFileToUpload = this.validateAndDisplayFileToUpload.bind(this); | |||
this.onDownloadButtonPress = this.onDownloadButtonPress.bind(this); |
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 believe this can be removed.
this.onDownloadButtonPress = this.onDownloadButtonPress.bind(this); |
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.
removed.
src/components/AttachmentModal.js
Outdated
// If the keyboard was open before clicking on attachment, after downloading | ||
// the attachment keyboard will show up, this line fixes that. |
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.
// If the keyboard was open before clicking on attachment, after downloading | |
// the attachment keyboard will show up, this line fixes that. | |
// At ios, if the keyboard is open while opening the attachment, then after downloading | |
// the attachment keyboard will show up. So, to fix it we need to dismiss the keyboard. |
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.
:D changed.
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.
Thanks 🚀
@Uros787 sorry for making the change again. Also a suggestion: try to keep the commit specific to the change. Like "rename the method" and for comment change a new commit message "change comment" |
ScreenshotsWeb Screen.Recording.2022-10-24.at.7.28.43.PM.movMobile Web - Chrome Screen.Recording.2022-10-24.at.7.30.52.PM.movMobile Web - Safari Screen.Recording.2022-10-24.at.7.36.41.PM.movDesktop Screen.Recording.2022-10-24.at.7.39.44.PM.moviOS Screen.Recording.2022-10-24.at.7.35.12.PM.movAndroid Screen.Recording.2022-10-24.at.7.31.56.PM.mov |
Looks good and tests well. cc: @ctkochan22 C+ reviewed 🎀👀🎀
|
@ctkochan22 looks like this was merged without the checklist test passing. Please add a note explaining why this was done and remove the |
Everything was checked off |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @ctkochan22 in version: 1.2.19-0 🚀
|
🚀 Deployed to production by @chiragsalian in version: 1.2.19-2 🚀
|
Details
Fixed Issues
$ #11525
PROPOSAL: #11525 (comment)
Tests / QA Steps
PR Review Checklist
PR Author Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting 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)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting 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
have been tested & I retested again)/** 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)Screenshots
Web
web.mov
Mobile Web - Chrome
android.chrome.mov
Mobile Web - Safari
ios.safari.mov
Desktop
desktop.mov
iOS
194939404-ecacb029-462b-4b2e-8f94-a0b51373fdf7.mov
Android
android.mov