From 36a8bafec0274bd48a58b4cb39c6b4f5e26b0fcf Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:06:24 +0100 Subject: [PATCH 1/4] Add onPaste for TextInput --- docs/textinput.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/textinput.md b/docs/textinput.md index 284cd34f774..5262da7d5ad 100644 --- a/docs/textinput.md +++ b/docs/textinput.md @@ -672,6 +672,16 @@ Note that on iOS this method isn't called when using `keyboardType="phone-pad"`. --- +### `onPaste` + +Callback that is called when the clipboard content is pasted. + +| Type | +| ---------------------------------- | +| (`{nativeEvent: {target}`) => void | + +--- + ### `placeholder` The string that will be rendered before text input has been entered. From 6f10bf77296bfbdb37c72c0c3bc1e642fad52a3c Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:52:42 +0100 Subject: [PATCH 2/4] Better onPaste comment --- docs/textinput.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/textinput.md b/docs/textinput.md index 5262da7d5ad..f3e281858e3 100644 --- a/docs/textinput.md +++ b/docs/textinput.md @@ -674,7 +674,7 @@ Note that on iOS this method isn't called when using `keyboardType="phone-pad"`. ### `onPaste` -Callback that is called when the clipboard content is pasted. +Invoked when the user performs the paste action. | Type | | ---------------------------------- | From cedc3920dd7058a2d29e2725aaa3c38c59c0f483 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Sat, 27 Jul 2024 01:47:20 +0100 Subject: [PATCH 3/4] updated onPaste event --- docs/textinput.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/textinput.md b/docs/textinput.md index f3e281858e3..0b71cdfd7e7 100644 --- a/docs/textinput.md +++ b/docs/textinput.md @@ -674,11 +674,11 @@ Note that on iOS this method isn't called when using `keyboardType="phone-pad"`. ### `onPaste` -Invoked when the user performs the paste action. +Invoked when the user performs the paste action. The `items` array contains one object where `type` and `data` are the MIME type and the content of the clipboard respectively. `data` is in plaintext if the type is `text/plain`, data URI (base64-encoded) otherwise. -| Type | -| ---------------------------------- | -| (`{nativeEvent: {target}`) => void | +| Type | +| --------------------------------------------------------- | +| (`{nativeEvent: {target, items: [{type, data}]}`) => void | --- From ea44fdcdb0e4d203540f639d6a76f4897058fa76 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Tue, 6 Aug 2024 22:29:42 +0100 Subject: [PATCH 4/4] onPaste event for files contains URI --- docs/textinput.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/textinput.md b/docs/textinput.md index 0b71cdfd7e7..0c96cb4951d 100644 --- a/docs/textinput.md +++ b/docs/textinput.md @@ -674,7 +674,7 @@ Note that on iOS this method isn't called when using `keyboardType="phone-pad"`. ### `onPaste` -Invoked when the user performs the paste action. The `items` array contains one object where `type` and `data` are the MIME type and the content of the clipboard respectively. `data` is in plaintext if the type is `text/plain`, data URI (base64-encoded) otherwise. +Invoked when the user performs the paste action. The `items` array contains one object where `type` and `data` are the MIME type and the content of the clipboard respectively. `data` is in plaintext if the type is `text/plain`, URI otherwise. | Type | | --------------------------------------------------------- |