-
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
alllow selection to copy nested markdown text style #17384
alllow selection to copy nested markdown text style #17384
Conversation
@jasperhuangg @eVoloshchak 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] |
PR is ready for review. edit: here is additional video to make sure it does not broke the current functionality. Screen.Recording.2023-04-13.at.14.08.27.mov |
Got hung up on another huge PR, will review this in ~12 hours |
@@ -43,7 +43,8 @@ const getHTMLOfSelection = () => { | |||
|
|||
// If clonedSelection has no text content this data has no meaning to us. | |||
if (clonedSelection.textContent) { | |||
let node = null; | |||
let parent; | |||
let child = clonedSelection; | |||
|
|||
// If selection starts and ends within same text node we use its parentNode. This is because we can't |
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.
Awesome job @bernhardoj, I didn't get a chance to review the proposal initially, but it's a really good explanation of the fix.
The code looks good to me.
Is this comment still true? Should we change it to reflect the changes we're making?
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 never found a case where the textContent
is empty. Maybe it will happen when we select an empty html tag, but I don't know how can we select empty html tag.
Also, I think this PR is not related to the textContent
, so I assume the comment is still true.
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-04-14.at.20.38.44.movMobile Web - ChromeScreen_Recording_20230414-204437_Chrome.mp4Mobile Web - SafariIMG_0018.MP4DesktopScreen.Recording.2023-04-14.at.20.40.23.moviOSIMG_0017.MP4AndroidScreen_Recording_20230414-204342_New.Expensify.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!
cc: @jasperhuangg
@jasperhuangg, friendly bump on the above |
✋ 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 https://github.com/jasperhuangg in version: 1.3.3-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.3-2 🚀
|
Details
When we select and copy a nested markdown text, only the innermost markdown is copied.
Fixed Issues
$ #17284
PROPOSAL: #17284 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Web/Desktop
_*test*_
_*test*_
Android/iOS/mWeb can't select a text, so I just make sure the copy to clipboard still works (even though it's not affected).
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-13.at.14.07.15.mov
Mobile Web - Chrome
Screen.Recording.2023-04-13.at.14.02.56.mov
Mobile Web - Safari
Screen.Recording.2023-04-13.at.14.05.10.mov
Desktop
Screen.Recording.2023-04-13.at.14.21.20.mov
iOS
Android
Screen.Recording.2023-04-13.at.14.03.55.mov