-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add MultilineTextInput paste support #1350
Add MultilineTextInput paste support #1350
Conversation
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.
Another dumb question: how much of this do you think might just work on iOS / iPadOS? Mostly curious =)
2b12d2b
to
0fcb9eb
Compare
0fcb9eb
to
b74a528
Compare
Can you resolve the conflicts in this one too? :) |
b74a528
to
6869e9a
Compare
Done ;-) |
Would it be possible to add an example test in RN-Tester? Perhaps extend the one for Drag/Drop? I extended the Drag/Drop by just having Screen.Recording.2022-09-08.at.10.37.41.AM.mov |
I can add or extend an example. No big deal ;-) |
6869e9a
to
800c202
Compare
@Saadnajmi here is a video from the sample added. Screen.Recording.2022-09-08.at.12.12.42.PM.mov |
This adds an `onPaste` event for `MultilineTextInput` that is fired when a pasting into the input, and includes the same `dataTransfer` info as the `onDrop` callback which is discussed here microsoft#842 This also fixes a typo in the API name ```onPaste``` exists atm only for macOS, but we have the corresponding change to also add it rnw if that is desired Should we also add a property ```pasteTypes``` similar to drag&drag drag(ged)Types?
800c202
to
bceb321
Compare
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.
Tested with the new test page example and it worked great! Thanks for the PR :)
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to #1350
This adds an `onPaste` event for `MultilineTextInput` that is fired when a pasting into the input, and includes the same `dataTransfer` info as the `onDrop` callback which is discussed here microsoft#842 This also fixes a typo in the API name ```onPaste``` exists atm only for macOS, but we have the corresponding change to also add it rnw if that is desired Should we also add a property ```pasteTypes``` similar to drag&drag drag(ged)Types? Co-authored-by: Scott Kyle <skyle@fb.com> # Conflicts: # Libraries/Components/TextInput/TextInput.js # Libraries/Text/TextInput/Multiline/RCTUITextView.m # packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js # Conflicts: # Libraries/Text/TextInput/Multiline/RCTUITextView.m
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350 # Conflicts: # Libraries/Components/TextInput/TextInput.js
This adds an `onPaste` event for `MultilineTextInput` that is fired when a pasting into the input, and includes the same `dataTransfer` info as the `onDrop` callback which is discussed here microsoft#842 This also fixes a typo in the API name ```onPaste``` exists atm only for macOS, but we have the corresponding change to also add it rnw if that is desired Should we also add a property ```pasteTypes``` similar to drag&drag drag(ged)Types? Co-authored-by: Scott Kyle <skyle@fb.com>
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350
This adds an `onPaste` event for `MultilineTextInput` that is fired when a pasting into the input, and includes the same `dataTransfer` info as the `onDrop` callback which is discussed here microsoft#842 This also fixes a typo in the API name ```onPaste``` exists atm only for macOS, but we have the corresponding change to also add it rnw if that is desired Should we also add a property ```pasteTypes``` similar to drag&drag drag(ged)Types? Co-authored-by: Scott Kyle <skyle@fb.com> # Conflicts: # Libraries/Components/TextInput/TextInput.js # Libraries/Text/TextInput/Multiline/RCTUITextView.m # packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js # Conflicts: # Libraries/Text/TextInput/Multiline/RCTUITextView.m
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types We want to ignore them in favor of plain text (NSPasteboardTypeString). This change allows to opt into a custom list of supported paste types. This is a follow-up to microsoft#1350 # Conflicts: # Libraries/Components/TextInput/TextInput.js
Please select one of the following
Summary
This adds an
onPaste
event forMultilineTextInput
that is fired when a pasting into the input, and includes the samedataTransfer
info as theonDrop
callback which is discussed here #842This also fixes a typo in the API name
This also adds logic to extract image size info from pasted images
Noteworthy:
onPaste
exists atm only for macOS, but we have the corresponding change to also add it rnw if that is desiredpasteTypes
similar to drag&dragdrag(ged)Types
?Changelog
[macOS] [Added] - Add MultilineTextInput paste support
Test Plan
Using this example with a paste handler. CMD+C, CMD+V
Screen.Recording.2022-08-10.at.4.05.26.PM.mov
Using that example w/o a paste handler. CMD+C, CMD+V and CMD+V again and again. And contextMenu paste
Screen.Recording.2022-08-10.at.4.06.00.PM.mov