Skip to content

Commit

Permalink
fix pop node height 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Feb 28, 2017
1 parent da5bbc2 commit 705b53c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Trigger.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const Trigger = React.createClass({
popupContainer.style.top = '0';
popupContainer.style.left = '0';
popupContainer.style.width = '100%';
popupContainer.style.height = '100%';
const mountNode = props.getPopupContainer ?
props.getPopupContainer(findDOMNode(instance)) : props.getDocument().body;
mountNode.appendChild(popupContainer);
Expand Down
17 changes: 17 additions & 0 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,5 +654,22 @@ describe('rc-trigger', function main() {
// height should be same, should not have break lines inside words
expect(popupNodeHeightOfOneWord).to.equal(popupNodeHeightOfSeveralWords);
});

// https://github.com/ant-design/ant-design/issues/5092
it('popup node height should be 100% as body', () => {
const trigger = ReactDOM.render(
<Trigger
popupVisible
popupAlign={placementAlignMap.top}
popup={<span>i am a pop up</span>}
popupStyle={{ height: '100%' }}
>
<div>trigger</div>
</Trigger>
, div);

// height should be same, should not have break lines inside words
expect(trigger.getPopupDomNode().offsetHeight).to.above(0);
});
});
});

0 comments on commit 705b53c

Please sign in to comment.