Skip to content

Commit d3280a2

Browse files
committed
handle refs
1 parent 4aca43f commit d3280a2

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/components/Modal.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var Modal = module.exports = React.createClass({
4949
if (props.ariaHideApp) {
5050
ariaAppHider.toggle(props.isOpen, props.appElement);
5151
}
52+
sanitizeProps(props);
5253
this.portal = React.renderComponent(ModalPortal(props), this.node);
5354
},
5455

@@ -57,3 +58,7 @@ var Modal = module.exports = React.createClass({
5758
}
5859
});
5960

61+
function sanitizeProps(props) {
62+
delete props.ref;
63+
}
64+

specs/Modal.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ describe('Modal', function () {
1212
it('has default props');
1313
it('removes the portal node');
1414
it('scopes tab navigation to the modal');
15-
it('ignores clicks outside of it');
1615
it('focuses the modal');
1716
it('focuses the last focused element when tabbing in from browser chrome');
1817
it('adds --after-open for animations');
1918
it('adds --before-close for animations');
19+
it('does not freak out when you hand it a ref');
2020
});
2121

0 commit comments

Comments
 (0)