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 |
| 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.
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.
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 |
eVoloshchak
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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