From a064624435b5879390c03cf251f7c90a2b52b0f7 Mon Sep 17 00:00:00 2001
From: OSBotify <76178356+OSBotify@users.noreply.github.com>
Date: Thu, 12 Aug 2021 17:40:12 -0700
Subject: [PATCH 1/2] Merge pull request #4638 from
Expensify/version-BUILD-ea0fb88147761c4ddc7e2d97d8e648e85f9b73d7
(cherry picked from commit 5361959f219b5f4d406ddc4e34422641f4e172aa)
---
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 37fc56e0e04fd..1dc80b8f77a52 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
- versionCode 1001008503
- versionName "1.0.85-3"
+ versionCode 1001008504
+ versionName "1.0.85-4"
}
splits {
abi {
diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist
index ad1206c58aab5..bbaa1f847e2ce 100644
--- a/ios/ExpensifyCash/Info.plist
+++ b/ios/ExpensifyCash/Info.plist
@@ -30,7 +30,7 @@
CFBundleVersion
- 1.0.85.3
+ 1.0.85.4
ITSAppUsesNonExemptEncryption
LSApplicationQueriesSchemes
diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist
index c02b84afec906..10f9dabd76b5f 100644
--- a/ios/ExpensifyCashTests/Info.plist
+++ b/ios/ExpensifyCashTests/Info.plist
@@ -19,6 +19,6 @@
CFBundleSignature
????
CFBundleVersion
- 1.0.85.3
+ 1.0.85.4
diff --git a/package-lock.json b/package-lock.json
index 8479da40a44a2..97af61b17c908 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
- "version": "1.0.85-3",
+ "version": "1.0.85-4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 941b6ed3e667d..a911d509473cd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
- "version": "1.0.85-3",
+ "version": "1.0.85-4",
"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 cf583f960673c9bd23015fb6128079d44eaac290 Mon Sep 17 00:00:00 2001
From: Joe Gambino
Date: Thu, 12 Aug 2021 17:37:57 -0700
Subject: [PATCH 2/2] Merge pull request #4632 from parasharrajat/newInput
Fix: autofill on the BaseExpensiInput
(cherry picked from commit ea0fb88147761c4ddc7e2d97d8e648e85f9b73d7)
---
.../ExpensiTextInput/BaseExpensiTextInput.js | 37 ++++++++++++++++---
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/src/components/ExpensiTextInput/BaseExpensiTextInput.js b/src/components/ExpensiTextInput/BaseExpensiTextInput.js
index 1b025e1778044..6c911d4fde855 100644
--- a/src/components/ExpensiTextInput/BaseExpensiTextInput.js
+++ b/src/components/ExpensiTextInput/BaseExpensiTextInput.js
@@ -2,6 +2,7 @@ import React, {Component} from 'react';
import {
Animated, TextInput, View, TouchableWithoutFeedback,
} from 'react-native';
+import Str from 'expensify-common/lib/str';
import ExpensiTextInputLabel from './ExpensiTextInputLabel';
import {propTypes, defaultProps} from './propTypes';
import themeColors from '../../styles/themes/default';
@@ -30,8 +31,11 @@ class BaseExpensiTextInput extends Component {
};
this.input = null;
+ this.value = hasValue ? props.value : '';
+ this.isLabelActive = false;
this.onFocus = this.onFocus.bind(this);
this.onBlur = this.onBlur.bind(this);
+ this.setValue = this.setValue.bind(this);
}
componentDidMount() {
@@ -44,20 +48,42 @@ class BaseExpensiTextInput extends Component {
onFocus() {
if (this.props.onFocus) { this.props.onFocus(); }
this.setState({isFocused: true});
- if (this.props.value.length === 0) {
+ this.activateLabel();
+ }
+
+ onBlur() {
+ if (this.props.onBlur) { this.props.onBlur(); }
+ this.setState({isFocused: false});
+ this.deactivateLabel();
+ }
+
+ /**
+ * Set Value & activateLabel
+ *
+ * @param {String} value
+ * @memberof BaseExpensiTextInput
+ */
+ setValue(value) {
+ this.value = value;
+ Str.result(this.props.onChangeText, value);
+ this.activateLabel();
+ }
+
+ activateLabel() {
+ if (this.value.length >= 0 && !this.isLabelActive) {
this.animateLabel(
ACTIVE_LABEL_TRANSLATE_Y,
ACTIVE_LABEL_TRANSLATE_X(this.props.translateX),
ACTIVE_LABEL_SCALE,
);
+ this.isLabelActive = true;
}
}
- onBlur() {
- if (this.props.onBlur) { this.props.onBlur(); }
- this.setState({isFocused: false});
- if (this.props.value.length === 0) {
+ deactivateLabel() {
+ if (this.value.length === 0) {
this.animateLabel(INACTIVE_LABEL_TRANSLATE_Y, INACTIVE_LABEL_TRANSLATE_X, INACTIVE_LABEL_SCALE);
+ this.isLabelActive = false;
}
}
@@ -133,6 +159,7 @@ class BaseExpensiTextInput extends Component {
style={inputStyle}
onFocus={this.onFocus}
onBlur={this.onBlur}
+ onChangeText={this.setValue}
/>