Skip to content

Commit

Permalink
handle refs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence committed Sep 24, 2014
1 parent 4aca43f commit d3280a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var Modal = module.exports = React.createClass({
if (props.ariaHideApp) {
ariaAppHider.toggle(props.isOpen, props.appElement);
}
sanitizeProps(props);
this.portal = React.renderComponent(ModalPortal(props), this.node);
},

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

function sanitizeProps(props) {
delete props.ref;
}

2 changes: 1 addition & 1 deletion specs/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ describe('Modal', function () {
it('has default props');
it('removes the portal node');
it('scopes tab navigation to the modal');
it('ignores clicks outside of it');
it('focuses the modal');
it('focuses the last focused element when tabbing in from browser chrome');
it('adds --after-open for animations');
it('adds --before-close for animations');
it('does not freak out when you hand it a ref');
});

0 comments on commit d3280a2

Please sign in to comment.