Skip to content

Commit

Permalink
Merge pull request #31547 from Expensify/jules-revert30679
Browse files Browse the repository at this point in the history
[NO QA] Revert PR 30679
  • Loading branch information
mountiny authored Nov 20, 2023
2 parents c7729bd + 8b980a6 commit 3ac55d2
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 30 deletions.
8 changes: 0 additions & 8 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2881,15 +2881,7 @@ const CONST = {

/** <input /> types that will show a virtual keyboard in a mobile browser */
INPUT_TYPES_WITH_KEYBOARD: ['text', 'search', 'tel', 'url', 'email', 'password'],
/**
* native IDs for close buttons in Overlay component
*/
OVERLAY: {
TOP_BUTTON_NATIVE_ID: 'overLayTopButton',
BOTTOM_BUTTON_NATIVE_ID: 'overLayBottomButton',
},

BACK_BUTTON_NATIVE_ID: 'backButton',
REFERRAL_PROGRAM: {
CONTENT_TYPES: {
MONEY_REQUEST: 'request',
Expand Down
10 changes: 0 additions & 10 deletions src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,7 @@ function Form(props) {
// We delay the validation in order to prevent Checkbox loss of focus when
// the user are focusing a TextInput and proceeds to toggle a CheckBox in
// web and mobile web platforms.

// Prevents React from resetting its properties
event.persist();
setTimeout(() => {
const relatedTargetId = lodashGet(event, 'nativeEvent.relatedTarget.id');
if (
relatedTargetId &&
_.includes([CONST.OVERLAY.BOTTOM_BUTTON_NATIVE_ID, CONST.OVERLAY.TOP_BUTTON_NATIVE_ID, CONST.BACK_BUTTON_NATIVE_ID], relatedTargetId)
) {
return;
}
setTouchedInput(inputID);
if (props.shouldValidateOnBlur) {
onValidate(inputValues, !hasServerError);
Expand Down
7 changes: 0 additions & 7 deletions src/components/Form/FormProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,7 @@ function FormProvider({validate, formID, shouldValidateOnBlur, shouldValidateOnC
// We delay the validation in order to prevent Checkbox loss of focus when
// the user is focusing a TextInput and proceeds to toggle a CheckBox in
// web and mobile web platforms.

// Prevents React from resetting its properties
event.persist();
setTimeout(() => {
const relatedTargetId = lodashGet(event, 'nativeEvent.relatedTarget.id');
if (relatedTargetId && _.includes([CONST.OVERLAY.BOTTOM_BUTTON_NATIVE_ID, CONST.OVERLAY.TOP_BUTTON_NATIVE_ID, CONST.BACK_BUTTON_NATIVE_ID], relatedTargetId)) {
return;
}
setTouchedInput(inputID);
if (shouldValidateOnBlur) {
onValidate(inputValues, !hasServerError);
Expand Down
1 change: 0 additions & 1 deletion src/components/HeaderWithBackButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function HeaderWithBackButton({
style={[styles.touchableButtonImage]}
role="button"
accessibilityLabel={translate('common.back')}
nativeID={CONST.BACK_BUTTON_NATIVE_ID}
>
<Icon
src={Expensicons.BackArrow}
Expand Down
2 changes: 1 addition & 1 deletion src/components/RoomNameInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function RoomNameInput({isFocused, autoFocus, disabled, errorText, forwardedRef,
onSelectionChange={(event) => setSelection(event.nativeEvent.selection)}
errorText={errorText}
autoCapitalize="none"
onBlur={(event) => isFocused && onBlur(event)}
onBlur={() => isFocused && onBlur()}
shouldDelayFocus={shouldDelayFocus}
autoFocus={isFocused && autoFocus}
maxLength={CONST.REPORT.MAX_ROOM_NAME_LENGTH}
Expand Down
2 changes: 1 addition & 1 deletion src/components/RoomNameInput/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function RoomNameInput({isFocused, autoFocus, disabled, errorText, forwardedRef,
errorText={errorText}
maxLength={CONST.REPORT.MAX_ROOM_NAME_LENGTH}
keyboardType={keyboardType} // this is a bit hacky solution to a RN issue https://github.com/facebook/react-native/issues/27449
onBlur={(event) => isFocused && onBlur(event)}
onBlur={() => isFocused && onBlur()}
autoFocus={isFocused && autoFocus}
autoCapitalize="none"
shouldDelayFocus={shouldDelayFocus}
Expand Down
2 changes: 0 additions & 2 deletions src/libs/Navigation/AppNavigator/Navigators/Overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ function Overlay(props) {
onPress={props.onPress}
accessibilityLabel={translate('common.close')}
role={CONST.ACCESSIBILITY_ROLE.BUTTON}
nativeID={CONST.OVERLAY.TOP_BUTTON_NATIVE_ID}
/>
<PressableWithoutFeedback
style={[styles.flex1]}
onPress={props.onPress}
accessibilityLabel={translate('common.close')}
role={CONST.ACCESSIBILITY_ROLE.BUTTON}
noDragArea
nativeID={CONST.OVERLAY.BOTTOM_BUTTON_NATIVE_ID}
/>
</View>
</Animated.View>
Expand Down

0 comments on commit 3ac55d2

Please sign in to comment.