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
1 change: 0 additions & 1 deletion src/components/Modal/BaseModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function BaseModal({
<View
style={[styles.defaultModalContainer, modalContainerStyle, modalPaddingStyles, !isVisible && styles.pointerEventsNone]}
ref={forwardedRef}
nativeID="no-drag-area"
>
{children}
</View>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Pressable/GenericPressable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const WebGenericPressable = forwardRef((props, ref) => (
aria-label={props.accessibilityLabel}
aria-labelledby={props.accessibilityLabelledBy}
aria-valuenow={props.accessibilityValue}
nativeID={props.nativeID || 'no-drag-area'}
nativeID={props.nativeID}
dataSet={{tag: 'pressable', ...(props.noDragArea && {dragArea: false})}}
/>
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,25 @@ function ThreePaneView(props) {
StyleUtils.displayIfTrue(props.state.index === i),
]}
>
<PressableWithoutFeedback
style={[styles.flex1]}
onPress={() => props.navigation.goBack()}
accessibilityLabel={translate('common.close')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
/>
<View style={[styles.flex1, styles.flexColumn]}>
{/* In the latest Electron version buttons can't be both clickable and draggable.
That's why we added this workaround. Because of two Pressable components on the desktop app
we have 30px draggable ba at the top and the rest of the dimmed area is clickable. On other devices,
everything behaves normally like one big pressable */}
<PressableWithoutFeedback
style={[styles.draggableTopBar]}
onPress={() => props.navigation.goBack()}
accessibilityLabel={translate('common.close')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
/>
<PressableWithoutFeedback
style={[styles.flex1]}
onPress={() => props.navigation.goBack()}
accessibilityLabel={translate('common.close')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
noDragArea

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causing this issue

/>
</View>
<View style={styles.rightPanelContainer}>{props.descriptors[route.key].render()}</View>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function HeaderView(props) {
return (
<View
style={[styles.appContentHeader, shouldShowBorderBottom && styles.borderBottom]}
nativeID="drag-area"
dataSet={{dragArea: true}}
>
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}>
{props.isSmallScreenWidth && (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class SidebarLinks extends React.PureComponent {
<View style={[styles.flex1, styles.h100]}>
<View
style={[styles.flexRow, styles.ph5, styles.pv3, styles.justifyContentBetween, styles.alignItemsCenter]}
nativeID="drag-area"
dataSet={{dragArea: true}}
>
<Header
title={
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3876,6 +3876,10 @@ const styles = {
fontSize: variables.fontSizeNormal,
marginRight: 4,
},
draggableTopBar: {
height: 30,
width: '100%',
},
};

export default styles;
7 changes: 4 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@
overscroll-behavior: none;
touch-action: none;
}
#drag-area {
[data-drag-area='true'] {
-webkit-app-region: drag;
}
#no-drag-area {
[data-drag-area='false'], [data-drag-area='true'] [data-tag="pressable"] {
-webkit-app-region: no-drag;

}
input::placeholder {
user-select: none;
Expand Down Expand Up @@ -132,7 +133,7 @@
<% } %>
</head>
<body>
<div style="position: absolute; top: 0; left: 0; right: 0; height: 30px;" id="drag-area"></div>
<div style="position: absolute; top: 0; left: 0; right: 0; height: 30px;" data-drag-area="true"></div>
<div id="root"></div>
<div id="splash">
<div class="splash-logo">
Expand Down