diff --git a/src/Modal.js b/src/Modal.js index 8e4022137f..148b856a8f 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -325,10 +325,6 @@ const Modal = React.createClass({ container.style.paddingRight = parseInt(this._originalPadding || 0, 10) + getScrollbarSize() + 'px'; } - if (this.props.backdrop) { - this.iosClickHack(); - } - this.setState(this._getStyles() //eslint-disable-line react/no-did-mount-set-state , () => this.focusModalContent()); }, @@ -418,14 +414,6 @@ const Modal = React.createClass({ } }, - iosClickHack() { - // IOS only allows click events to be delegated to the document on elements - // it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the - // DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169 - this.refs.modal.onclick = function () {}; - this.refs.backdrop.onclick = function () {}; - }, - _getStyles() { if (!domUtils.canUseDom) { return {}; diff --git a/src/OverlayTrigger.js b/src/OverlayTrigger.js index 93a64e4238..079b4a0c49 100644 --- a/src/OverlayTrigger.js +++ b/src/OverlayTrigger.js @@ -8,7 +8,6 @@ import warning from 'warning'; import Overlay from './Overlay'; import createChainedFunction from './utils/createChainedFunction'; -import createContextWrapper from './utils/createContextWrapper'; /** * Check if value one is inside or equal to the of value @@ -263,20 +262,4 @@ const OverlayTrigger = React.createClass({ }); -/** - * Creates a new OverlayTrigger class that forwards the relevant context - * - * This static method should only be called at the module level, instead of in - * e.g. a render() method, because it's expensive to create new classes. - * - * For example, you would want to have: - * - * > export default OverlayTrigger.withContext({ - * > myContextKey: React.PropTypes.object - * > }); - * - * and import this when needed. - */ -OverlayTrigger.withContext = createContextWrapper(OverlayTrigger, 'overlay'); - export default OverlayTrigger; diff --git a/src/utils/createContextWrapper.js b/src/utils/createContextWrapper.js deleted file mode 100644 index 37e8a1a82e..0000000000 --- a/src/utils/createContextWrapper.js +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; - -/** - * Creates new trigger class that injects context into overlay. - */ -export default function createContextWrapper(Trigger, propName) { - return function (contextTypes) { - class ContextWrapper extends React.Component { - getChildContext() { - return this.props.context; - } - - render() { - // Strip injected props from below. - const {wrapped, context, ...props} = this.props; - - return React.cloneElement(wrapped, props); - } - } - ContextWrapper.childContextTypes = contextTypes; - - class TriggerWithContext { - render() { - const props = {...this.props}; - props[propName] = this.getWrappedOverlay(); - - return ( - - {this.props.children} - - ); - } - - getWrappedOverlay() { - return ( - - ); - } - } - TriggerWithContext.contextTypes = contextTypes; - - return TriggerWithContext; - }; -} diff --git a/test/OverlayTriggerSpec.js b/test/OverlayTriggerSpec.js index 866129e15f..7583a83d69 100644 --- a/test/OverlayTriggerSpec.js +++ b/test/OverlayTriggerSpec.js @@ -103,7 +103,6 @@ describe('OverlayTrigger', function() { } ContextReader.contextTypes = contextTypes; - const TriggerWithContext = OverlayTrigger.withContext(contextTypes); class ContextHolder extends React.Component { getChildContext() { return {key: 'value'}; @@ -111,12 +110,12 @@ describe('OverlayTrigger', function() { render() { return ( - } > - + ); } }