From 405338e6e0c322ee23a022234ccbe2ddc9a16018 Mon Sep 17 00:00:00 2001
From: OSBotify <76178356+OSBotify@users.noreply.github.com>
Date: Tue, 20 Jul 2021 09:02:20 -0700
Subject: [PATCH 1/2] Merge pull request #4148 from
Expensify/version-BUILD-7b5d3edba6087d6d2863502c59104cd2b24b9bcb
(cherry picked from commit da89c93adc9e591a2c55ecb735480d809d37c7ba)
---
android/app/build.gradle | 4 ++--
ios/ExpensifyCash/Info.plist | 2 +-
ios/ExpensifyCashTests/Info.plist | 2 +-
package-lock.json | 2 +-
package.json | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/android/app/build.gradle b/android/app/build.gradle
index fd1c17438c33..e1729d83f5d8 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -149,8 +149,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
- versionCode 1001007901
- versionName "1.0.79-1"
+ versionCode 1001007902
+ versionName "1.0.79-2"
}
splits {
abi {
diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist
index 2f023b073f2c..c014a4806eca 100644
--- a/ios/ExpensifyCash/Info.plist
+++ b/ios/ExpensifyCash/Info.plist
@@ -30,7 +30,7 @@
CFBundleVersion
- 1.0.79.1
+ 1.0.79.2
ITSAppUsesNonExemptEncryption
LSApplicationQueriesSchemes
diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist
index 2ef90f227082..9986aa0999ed 100644
--- a/ios/ExpensifyCashTests/Info.plist
+++ b/ios/ExpensifyCashTests/Info.plist
@@ -19,6 +19,6 @@
CFBundleSignature
????
CFBundleVersion
- 1.0.79.1
+ 1.0.79.2
diff --git a/package-lock.json b/package-lock.json
index 2f87199e63bd..ef762ac472c0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "expensify.cash",
- "version": "1.0.79-1",
+ "version": "1.0.79-2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index cc972d8accbe..11d53009dea8 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "expensify.cash",
- "version": "1.0.79-1",
+ "version": "1.0.79-2",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
From f1f8482b2a264fb34b264df53683c6c855fc5ffe Mon Sep 17 00:00:00 2001
From: Horus Lugo
Date: Mon, 19 Jul 2021 16:27:46 +0200
Subject: [PATCH 2/2] Merge pull request #4131 from parasharrajat/paste-html
fix: paste and Ctrl+z
(cherry picked from commit f9d00588af0446263c4927ae0d34f76940e0f0e3)
---
src/components/TextInputFocusable/index.js | 30 +++++-----------------
1 file changed, 6 insertions(+), 24 deletions(-)
diff --git a/src/components/TextInputFocusable/index.js b/src/components/TextInputFocusable/index.js
index 1ee3da703a2b..5ace8e0e8d9a 100755
--- a/src/components/TextInputFocusable/index.js
+++ b/src/components/TextInputFocusable/index.js
@@ -115,11 +115,6 @@ class TextInputFocusable extends React.Component {
end: initialValue.length,
},
};
- this.selection = {
- start: initialValue.length,
- end: initialValue.length,
- };
- this.saveSelection = this.saveSelection.bind(this);
this.dragNDropListener = this.dragNDropListener.bind(this);
this.handlePaste = this.handlePaste.bind(this);
this.handlePastedHTML = this.handlePastedHTML.bind(this);
@@ -232,17 +227,6 @@ class TextInputFocusable extends React.Component {
}
}
- /**
- * Keeps track of user cursor position on the Composer
- *
- * @param {{nativeEvent: {selection: any}}} event
- * @memberof TextInputFocusable
- */
- saveSelection(event) {
- this.selection = event.nativeEvent.selection;
- this.props.onSelectionChange(event);
- }
-
/**
* Manually place the pasted HTML into Composer
*
@@ -252,13 +236,11 @@ class TextInputFocusable extends React.Component {
handlePastedHTML(html) {
const parser = new ExpensiMark();
const markdownText = parser.htmlToMarkdown(html);
- const beforeCursorText = this.textInput.value.substring(0, this.selection.start);
- const afterCursorText = this.textInput.value.substring(this.selection.end);
- this.textInput.value = beforeCursorText + markdownText + afterCursorText;
- const newCursorPosition = beforeCursorText.length + markdownText.length;
- this.setState({selection: {start: newCursorPosition, end: newCursorPosition}});
- this.updateNumberOfLines();
- this.props.onChangeText(this.textInput.value);
+ try {
+ document.execCommand('insertText', false, markdownText);
+ this.updateNumberOfLines();
+ // eslint-disable-next-line no-empty
+ } catch (e) {}
}
/**
@@ -353,7 +335,7 @@ class TextInputFocusable extends React.Component {
onChange={() => {
this.updateNumberOfLines();
}}
- onSelectionChange={this.saveSelection}
+ onSelectionChange={this.onSelectionChange}
numberOfLines={this.state.numberOfLines}
style={propStyles}
/* eslint-disable-next-line react/jsx-props-no-spreading */