-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 issues with newlines when copypasting #15034
Fix issues with newlines when copypasting #15034
Conversation
@Luke9389 @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] |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
ad32b4e
to
1567fac
Compare
Asked in Slack |
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.
Reviewer Checklist
Screenshots/VideosWeb15034.Web.movMobile Web - Chrome15034.mWeb-Chrome.mp4Mobile Web - Safari15034.mWeb-Safari.mp4Desktop15034.Desktop.moviOS15034.iOS.mp4Android15034.Android.mp4 |
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.
LGTM 👍
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.
Thank you @mollfpr
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.2.71-0 🚀
|
// Thanks to how browsers work, when text is highlighted and CTRL+c is pressed, browsers end up doubling the amount of newlines. Since the code in this file is | ||
// triggered from a context menu and not CTRL+c, the newlines need to be doubled so that the content that goes into the clipboard is consistent with CTRL+c behavior. | ||
// The extra newlines are stripped when the contents are pasted into the compose input, but if the contents are pasted outside of the comment composer, it will | ||
// contain extra newlines and that's OK because it is consistent with CTRL+c behavior. |
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.
Did we ever get to the bottom of why this comment was added or whether it's accurate? Maybe this wasn't browser behavior after all?
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.
It's very possible I was misunderstanding the behavior when I wrote that comment :D
🚀 Deployed to production by https://github.com/francoisl in version: 1.2.71-1 🚀
|
Details
Unified the way of copy-pasting texts in the
Composer
. After that change, when pasting text intoComposer
input, the amount of newlines will remain unchanged, no matter what the source of the copied text is.Fixed Issues
$ #14243
$ #14337
PROPOSAL: #14243 (comment)
Tests
As @tgolen did an amazing job with putting all the test scenarios together, i'll just copy-paste the list from #13739
Use the following text for the test (it has 4 newlines):
Web/Desktop
Native and mobile web
Native platforms do not have a paste without formatting feature, so just do basic regression testing to ensure pasting functions normally
Offline tests
n/a this feature doesn't change or is impacted by offline mode
QA Steps
Same as above
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
WEB.mov
Mobile Web - Chrome
ANDROID-WEB.mov
Mobile Web - Safari
IOS-WEB.mov
Desktop
DESKTOP.mov
iOS
IOS.mov
Android
ANDROID.mov