-
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
22803 - Pasting text or link in edit message pastes the text or link in main compose box #22817
Conversation
I've record the videos for platforms which handle copy&pasting without focus. Let me know if I should record all others. |
@Santhosh-Sellavel Please 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] |
On it |
Thanks for the urgency @Santhosh-Sellavel ! |
Reviewer Checklist
Screenshots/VideosWeb & DesktopScreen.Recording.2023-07-13.at.10.32.37.PM.movMobile Web - Chrome & Mobile Web - SafariScreen.Recording.2023-07-13.at.10.29.36.PM.mov |
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, all yours @PauloGasparSv!
Thanks for the quick fix everyone. @cristipaval do you mind requesting a CP for this in #deployer please? We're trying to close the checklist ASAP today. |
Actually nevermind, I got this 😄 |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
22803 - Pasting text or link in edit message pastes the text or link in main compose box (cherry picked from commit a306694)
🚀 Deployed to staging by https://github.com/cristipaval in version: 1.3.40-4 🚀
|
handlePaste(event) { | ||
if (!this.props.checkComposerVisibility() && !this.state.isFocused) { | ||
if (!this.props.checkComposerVisibility()) { | ||
return; | ||
} | ||
|
||
if (['INPUT', 'TEXTAREA'].includes(event.target.nodeName)) { |
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.
@robertKozik This is flawed in the root itself. this.props.checkComposerVisibility()
always fails for edit message items as we didn't pass checkComposerVisibility
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 event is called twice
one from each instance. We should perform the operation only when it's from the textInput
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.
Yeah you're right. I'm also looking for the another fix for this one. Did you check if pasting to the edited comment works?
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'm not sure that paste event should be trigger only from focused input. The "parent" issue and PR #21583 was introducing the ability to paste when input is not composed
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.
No, it didn't work.
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 snippet addresses both issues, but now if I edit an existing message and paste from the clipboard, the cursor remains at the beginning of the pasted message:
Screen.Recording.2023-07-13.at.1.37.54.PM.mov
I'd say let's revert this for now, and then work on a proper fix without having to rush.
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.
Yes agreed lets do that first!
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 one comes out of nowhere.
Please revert this first and lets work on the other issue alone!
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.
Revert open here #22845, feel free to review.
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.
@robertKozik about the cursor issue
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.40-5 🚀
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 1.3.42-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.42-26 🚀
|
Details
it's follow up fix for #21583 copy&paste handler wasn't checking whether the incoming event fired from text input/area. It should be handled in a similar manner to the document-scoped keyPressListner
Fixed Issues
$ #22803
PROPOSAL:
Tests
Offline tests
Same as test steps
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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-07-13.at.18.18.23.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Screen.Recording.2023-07-13.at.18.22.51.mov
iOS
Android