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

Fix popover menu anchor alignment prop #19849

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions src/styles/getVerticalOffset/index.desktop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default (vertical) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add JS Doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// On desktop app we are adding a header gap of 12px
// which we need to add to vertical offset when setting
// offset on desktop
vertical: vertical + 12,
Copy link
Collaborator

Choose a reason for hiding this comment

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

12 should be made as CONST and used at both places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

});
1 change: 1 addition & 0 deletions src/styles/getVerticalOffset/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default (vertical) => ({vertical});
7 changes: 4 additions & 3 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import writingDirection from './utilities/writingDirection';
import optionAlternateTextPlatformStyles from './optionAlternateTextPlatformStyles';
import pointerEventsNone from './pointerEventsNone';
import pointerEventsAuto from './pointerEventsAuto';
import getVerticalOffset from './getVerticalOffset';
import overflowXHidden from './overflowXHidden';
import CONST from '../CONST';
import cursor from './utilities/cursor';
Expand Down Expand Up @@ -1240,7 +1241,7 @@ const styles = {

createMenuPositionProfile: (windowWidth) => ({
horizontal: windowWidth - 355,
vertical: 162,
...getVerticalOffset(162),
}),

createMenuPositionReportActionCompose: (windowHeight) => ({
Expand Down Expand Up @@ -2938,12 +2939,12 @@ const styles = {
},

threeDotsPopoverOffset: (windowWidth) => ({
vertical: 60,
...getVerticalOffset(60),
horizontal: windowWidth - 60,
}),

threeDotsPopoverOffsetNoCloseButton: (windowWidth) => ({
vertical: 60,
...getVerticalOffset(60),
horizontal: windowWidth - 10,
}),

Expand Down