-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Popover fixes on tablet #7985
Popover fixes on tablet #7985
Changes from 15 commits
5ba0ced
fdad9d6
9555227
ec1782c
386c9ce
43a065d
2b72247
4485d7c
2c04b2b
7aaf507
ba97201
b79bcd0
2347155
75b9383
0cdfef3
01c25e1
e19e89e
72503a4
53088a4
03eaeff
dcaefb5
e844694
1274f09
0e8c648
0573370
bbcaa8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -186,7 +186,10 @@ class AvatarWithImagePicker extends React.Component { | |||||
: ( | ||||||
<DefaultAvatar /> | ||||||
)} | ||||||
<AttachmentPicker type={CONST.ATTACHMENT_PICKER_TYPE.IMAGE}> | ||||||
<AttachmentPicker | ||||||
anchorPosition={styles.createMenuPositionProfile} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||||||
type={CONST.ATTACHMENT_PICKER_TYPE.IMAGE} | ||||||
> | ||||||
{({openPicker}) => ( | ||||||
<> | ||||||
{ | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import React from 'react'; | |
import {propTypes as popoverPropTypes, defaultProps} from './popoverPropTypes'; | ||
import CONST from '../../CONST'; | ||
import Modal from '../Modal'; | ||
import {windowDimensionsPropTypes} from '../withWindowDimensions'; | ||
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions'; | ||
|
||
const propTypes = { | ||
...(_.omit(popoverPropTypes, _.keys(windowDimensionsPropTypes))), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs correction now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. I have left only that propTypes from popoverPropTypes without omitting windowDimensionsProps |
||
|
@@ -17,8 +17,8 @@ const Popover = (props) => { | |
const propsWithoutAnimation = _.omit(props, ['animationIn', 'animationOut', 'popoverAnchorPosition', 'disableAnimation']); | ||
return ( | ||
<Modal | ||
type={props.fromSidebarMediumScreen ? CONST.MODAL.MODAL_TYPE.POPOVER : CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED} | ||
popoverAnchorPosition={props.fromSidebarMediumScreen ? props.anchorPosition : undefined} | ||
type={!props.isSmallScreenWidth ? CONST.MODAL.MODAL_TYPE.POPOVER : CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED} | ||
popoverAnchorPosition={!props.isSmallScreenWidth ? props.anchorPosition : undefined} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...propsWithoutAnimation} | ||
|
||
|
@@ -33,4 +33,4 @@ Popover.propTypes = propTypes; | |
Popover.defaultProps = defaultProps; | ||
Popover.displayName = 'Popover'; | ||
|
||
export default Popover; | ||
export default withWindowDimensions(Popover); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
/** | ||
* We don't need to get the position of the element on native platforms because the popover will be bottom mounted | ||
* | ||
* @param {Object} nativeEvent | ||
* @returns {Object} | ||
*/ | ||
function getClickedElementLocation() { | ||
function getClickedElementLocation(nativeEvent) { | ||
return { | ||
bottom: 0, | ||
left: 0, | ||
bottom: nativeEvent.nativeEvent.pageY - nativeEvent.nativeEvent.locationY, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. Based on previous handling of this, I have changed the code that calls this method to pass the nested |
||
left: nativeEvent.nativeEvent.pageX - nativeEvent.nativeEvent.locationX, | ||
}; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you add the new prop definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the prop definiton.