mirror of
https://github.com/zhigang1992/react-native-popover-view.git
synced 2026-01-12 17:42:41 +08:00
Potential fix to Issue #21
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-popover-view",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.14",
|
||||
"description": "A <Popover /> component for react-native",
|
||||
"main": "src/index.js",
|
||||
"author": "Peter Steffey <steffeydev@icloud.com> (https://github.com/steffeydev)",
|
||||
|
||||
@@ -230,8 +230,8 @@ class Popover extends React.Component {
|
||||
height: displayArea.height
|
||||
},
|
||||
viewLargerThanDisplayArea: {
|
||||
width: preferedX < minX,
|
||||
height: preferedY < minY
|
||||
width: preferedX < minX - 1,
|
||||
height: preferedY < minY - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,8 +249,8 @@ class Popover extends React.Component {
|
||||
}
|
||||
|
||||
let viewLargerThanDisplayArea = {
|
||||
height: preferedY < minY,
|
||||
width: requestedContentSize.width > displayArea.width
|
||||
height: preferedY < minY - 1,
|
||||
width: requestedContentSize.width > Math.ceil(displayArea.width)
|
||||
}
|
||||
|
||||
let viewWidth = viewLargerThanDisplayArea.width ? forcedContentSize.width : requestedContentSize.width;
|
||||
@@ -290,8 +290,8 @@ class Popover extends React.Component {
|
||||
}
|
||||
|
||||
let viewLargerThanDisplayArea = {
|
||||
height: preferedY + requestedContentSize.height > displayArea.y + displayArea.height,
|
||||
width: requestedContentSize.width > displayArea.width
|
||||
height: preferedY + requestedContentSize.height > Math.ceil(displayArea.y + displayArea.height),
|
||||
width: requestedContentSize.width > Math.ceil(displayArea.width)
|
||||
}
|
||||
|
||||
let viewWidth = viewLargerThanDisplayArea.width ? forcedContentSize.width : requestedContentSize.width;
|
||||
@@ -334,8 +334,8 @@ class Popover extends React.Component {
|
||||
}
|
||||
|
||||
let viewLargerThanDisplayArea = {
|
||||
height: requestedContentSize.height > displayArea.height,
|
||||
width: requestedContentSize.width > fromRect.x - displayArea.x - arrowSize.width
|
||||
height: requestedContentSize.height > Math.ceil(displayArea.height),
|
||||
width: requestedContentSize.width > Math.ceil(fromRect.x - displayArea.x - arrowSize.width)
|
||||
}
|
||||
|
||||
let viewWidth = viewLargerThanDisplayArea.width ? forcedContentSize.width : requestedContentSize.width;
|
||||
@@ -378,8 +378,8 @@ class Popover extends React.Component {
|
||||
}
|
||||
|
||||
let viewLargerThanDisplayArea = {
|
||||
height: requestedContentSize.height > displayArea.height,
|
||||
width: requestedContentSize.width > horizontalSpace
|
||||
height: requestedContentSize.height > Math.ceil(displayArea.height),
|
||||
width: requestedContentSize.width > Math.ceil(horizontalSpace)
|
||||
}
|
||||
|
||||
let viewHeight = viewLargerThanDisplayArea.height ? forcedContentSize.height : requestedContentSize.height;
|
||||
|
||||
@@ -44,7 +44,7 @@ export function runAfterChange(getFirst, second, func) {
|
||||
checkFunc();
|
||||
}
|
||||
|
||||
export function waitForNewRect(ref, initialRect, onFinish, verticalOffset) {
|
||||
export function waitForNewRect(ref, initialRect, onFinish, verticalOffset = 0) {
|
||||
runAfterChange(callback => {
|
||||
NativeModules.UIManager.measure(findNodeHandle(ref), (x0, y0, width, height, x, y) => {
|
||||
callback(new Rect(x, y + verticalOffset, width, height));
|
||||
|
||||
Reference in New Issue
Block a user