Skip to content
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
4 changes: 3 additions & 1 deletion src/components/PressableWithSecondaryInteraction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class PressableWithSecondaryInteraction extends Component {
*/
executeSecondaryInteractionOnContextMenu(e) {
const selection = window.getSelection().toString();
e.preventDefault();
if (this.props.preventDefaultContentMenu) {
e.preventDefault();
}
this.props.onSecondaryInteraction(e, selection);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ const propTypes = {

/** The ref to the search input (may be null on small screen widths) */
forwardedRef: PropTypes.func,

/** Prevent the default ContextMenu on web/Desktop */
preventDefaultContentMenu: PropTypes.bool,
};

const defaultProps = {
forwardedRef: () => {},
onPressIn: () => {},
onPressOut: () => {},
preventDefaultContentMenu: true,
};

export {propTypes, defaultProps};
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class ReportActionItem extends Component {
onPressIn={() => this.props.isSmallScreenWidth && canUseTouchScreen() && ControlSelection.block()}
onPressOut={() => ControlSelection.unblock()}
onSecondaryInteraction={this.showPopover}
preventDefaultContentMenu={!this.props.draftMessage}
>
<Hoverable resetsOnClickOutside={false}>
{hovered => (
Expand Down