Skip to content
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

[NO QA] Revert PR 30679 #31547

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2882,15 +2882,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
Loading