diff --git a/src/index.js b/src/index.js index 3f45312..a1558f5 100644 --- a/src/index.js +++ b/src/index.js @@ -42,6 +42,8 @@ type Props = { onOpenTooltipMenu?: () => void, onCloseTooltipMenu?: () => void, onPress?: () => void, + onLongPress?: () => void, + onHideModal?: () => void, componentContainerStyle?: StyleObj, timingConfig?: { duration?: number }, springConfig?: { tension?: number, friction?: number }, @@ -98,6 +100,7 @@ class PopoverTooltip extends React.PureComponent { labelSeparatorColor: "#E1E1E1", onRequestClose: () => {}, setBelow: false, + onLongPress: () => null, delayLongPress: 100, triangleOffset: 0, }; @@ -322,6 +325,7 @@ class PopoverTooltip extends React.PureComponent { styles.tooltipContainer, this.props.tooltipContainerStyle, tooltipContainerStyle, + { marginTop: -20 } ]} > { { } toggle = () => { + if (this.state.isModalOpen) { this.hideModal(); + this.props.onRequestClose() } else { + this.props.onLongPress() this.openModal(); } }