Whenever I'm using the Modal component I'm getting the warning:
_warning.js:36_ Warning: Failed prop type: Prop
closeOnRootNodeClickinPortalconflicts with props:closeOnDocumentClick. They cannot be defined together, choose one or the other.Steps
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, Header, Image, Modal } from 'semantic-ui-react'
const ModalModalExample = () => (
<Modal trigger={<Button>Show Modal</Button>}>
<Modal.Header>Select a Photo</Modal.Header>
<Modal.Content image>
<Image wrapped size='medium' src='http://semantic-ui.com/images/avatar2/large/rachel.png' />
<Modal.Description>
<Header>Default Profile Image</Header>
<p>We've found the following gravatar image associated with your e-mail address.</p>
<p>Is it okay to use this photo?</p>
</Modal.Description>
</Modal.Content>
</Modal>
)
const mountNode = document.createElement('div')
document.body.appendChild(mountNode)
ReactDOM.render(<ModalModalExample />, mountNode)
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'assets/build/dop/js');
var APP_DIR = path.resolve(__dirname, 'assets/src/js');
var config = {
entry: APP_DIR + '/app.js',
output: {
path: BUILD_DIR,
filename: 'app.js'
},
module : {
loaders : [
{
test : /\.jsx?/,
include : APP_DIR,
loader : 'babel'
}
]
}
};
module.exports = config;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %}DOP{% endblock %}</title>
<link rel="stylesheet" href="/static/dop/vendor/semantic.min.css" />
<link rel="stylesheet" href="/static/dop/css/style.css">
<script src="/static/dop/vendor/jquery.min.js"></script>
<script src="/static/dop/vendor/semantic.min.js"></script>
</head>
<body>
<div class="ui text container">
<div id="content"></div>
<script src="/static/dop/js/app.js"></script>
</div>
</body>
</html>
Button that triggers the modal.
closeOnRootNodeClick in Portal conflicts with props: closeOnDocumentClick. They cannot be defined together, choose one or the other.0.56.4
Now, I made this testcase http://codepen.io/anon/pen/ALJxWj, but that does not show this warning. What can be different about the codepen and my code example?
This report is superb, thank you. The warnings do not show in the codepen because it is a production build of Semantic-UI-React and warnings only show in development.
I've started the fix in #700 and will merge it soon.
Released in [email protected]
I'm still getting the same error .. on version 0.60.9
Running with semantic-ui-react 0.64.0 and for a while I haven't used the closeOnDocumentClick prop, but now I decided to use it again and now I get the following warning:
Warning: Failed prop type: Prop
closeOnRootNodeClickinPortalconflicts with props:closeOnDocumentClick. They cannot be defined together, choose one or the other.
Code similar to initial post, but now with the following:
<Modal dimmer="inverted" open={open} onClose={this.onClose} closeOnDocumentClick={true} closeOnEscape={true}></Modal>
Most helpful comment
Released in
[email protected]