-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
mWeb/Chrome - Chat- The details page and bottom navigation menu open at the same time #13307
Comments
Triggered auto assignment to @muttmuure ( |
Proposaldiff --git a/src/components/PressableWithSecondaryInteraction/index.js b/src/components/PressableWithSecondaryInteraction/index.js
index a6b21a59e1..b2d918d784 100644
--- a/src/components/PressableWithSecondaryInteraction/index.js
+++ b/src/components/PressableWithSecondaryInteraction/index.js
@@ -5,6 +5,8 @@ import {LongPressGestureHandler, State} from 'react-native-gesture-handler';
import * as pressableWithSecondaryInteractionPropTypes from './pressableWithSecondaryInteractionPropTypes';
import styles from '../../styles/styles';
import hasHoverSupport from '../../libs/hasHoverSupport';
+import CONST from '../../CONST';
+import * as Browser from '../../libs/Browser';
/**
* This is a special Pressable that calls onSecondaryInteraction when LongPressed, or right-clicked.
@@ -64,20 +66,39 @@ class PressableWithSecondaryInteraction extends Component {
const defaultPressableProps = _.omit(this.props, ['onSecondaryInteraction', 'children', 'onLongPress']);
// On Web, Text does not support LongPress events thus manage inline mode with styling instead of using Text.
+
+ // On LongPress browsers fire contextmenu event triggering the secondary interaction
+ // However Safari does not, thus we use LongPressGestureHandler
+ if (Browser.getBrowser() === CONST.BROWSER.SAFARI) {
+ return (
+ <LongPressGestureHandler onHandlerStateChange={this.callSecondaryInteractionWithMappedEvent}>
+ <Pressable
+ style={this.props.inline && styles.dInline}
+ onPressIn={this.props.onPressIn}
+ onPressOut={this.props.onPressOut}
+ onPress={this.props.onPress}
+ ref={el => this.pressableRef = el}
+ // eslint-disable-next-line react/jsx-props-no-spreading
+ {...defaultPressableProps}
+ >
+ {this.props.children}
+ </Pressable>
+ </LongPressGestureHandler>
+ );
+ }
+
return (
- <LongPressGestureHandler onHandlerStateChange={this.callSecondaryInteractionWithMappedEvent}>
- <Pressable
- style={this.props.inline && styles.dInline}
- onPressIn={this.props.onPressIn}
- onPressOut={this.props.onPressOut}
- onPress={this.props.onPress}
- ref={el => this.pressableRef = el}
- // eslint-disable-next-line react/jsx-props-no-spreading
- {...defaultPressableProps}
- >
- {this.props.children}
- </Pressable>
- </LongPressGestureHandler>
+ <Pressable
+ style={this.props.inline && styles.dInline}
+ onPressIn={this.props.onPressIn}
+ onPressOut={this.props.onPressOut}
+ onPress={this.props.onPress}
+ ref={el => this.pressableRef = el}
+ // eslint-disable-next-line react/jsx-props-no-spreading
+ {...defaultPressableProps}
+ >
+ {this.props.children}
+ </Pressable>
);
}
} DetailsThe issue is caused by the use of Long pressing an item will fire the However, Safari does not seem to be firing that event on long press, so I kept |
Thanks for the proposal @s77rt , I played with it a bit and noticed that:
I don't think we want this solution because it introduces code that renders differently depending on the browser, adding more complexity for little gain. I say little gain because it doesn't fix the bug completely (the bug still exists for Safari) and the bug itself is an edge case that doesn't block the user from using the app. Note: If we remove |
I wonder if we have an easy way of detecting that a modal (PersonalDetails in this case) has been opened and abort opening the ContextMenu in this case |
When we are looking at a chat, Something that works across browsers could be to add this check: if (!Navigation.getActiveRoute().startsWith(`/${ROUTES.REPORT}/`)) {
console.log('Abort, not in report anymore!');
return;
} |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Asked for opinions on how to proceed here: https://expensify.slack.com/archives/C01GTK53T8Q/p1670294483056029 Because of the issue being an edge case (unlikely to happen) and low ROI, it may be better to just do nothing. @muttmuure do you think we should close? |
I'll go ahead a close considering the slack conversation. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Issue found we executing PR #13204
Action Performed:
Expected Result:
The standard details popover is opened
Actual Result:
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.36.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug5846018_Record_2022-12-03-01-24-00.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: