Skip to content

Commit

Permalink
fix bug in OverlayPopoverView, #70
Browse files Browse the repository at this point in the history
  • Loading branch information
rilyu committed Oct 10, 2017
1 parent c3eff72 commit 1c83f1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions components/Overlay/OverlayPopoverView.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class OverlayPopoverView extends OverlayView {
default: arrow = 'top'; break;
}
}
popoverStyle = [].concat(popoverStyle).concat({position: 'absolute', left: 0, top: 0, opacity: 0});
popoverStyle = [].concat(popoverStyle).concat({position: 'absolute', left: 0, top: 0});
this.props = {popoverStyle, direction, showArrow, arrow, ...others};
return;
}
Expand Down Expand Up @@ -182,12 +182,20 @@ export default class OverlayPopoverView extends OverlayView {

renderContent() {
let {popoverStyle, arrow, paddingCorner, children} = this.props;

//in react native 0.49, this.props will not reset at rerender, then move opacity=0 to here
let {popoverWidth, popoverHeight} = this.state;
if (popoverWidth === null || popoverHeight === null) {
popoverStyle = popoverStyle.concat({opacity: 0});
}

return (
<Popover
style={popoverStyle}
arrow={arrow}
paddingCorner={paddingCorner}
onLayout={(e) => this.onPopoverLayout(e)}>
onLayout={(e) => this.onPopoverLayout(e)}
>
{children}
</Popover>
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teaset",
"version": "0.4.2",
"version": "0.4.3",
"description": "A UI library for react native.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 1c83f1b

Please sign in to comment.