-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE Modal error #750
Comments
We use Node.contains() in a couple places. We may need to replace this with a util. Can you paste the full error output including any stack trace? |
I'm not seeing any stack trace on my end and the most i can see if that were its erroring out in IE is the specific line,
in portal.js |
I turned the debugger on in the console for the modal and see that the error occurs after this. semanticUIReact:modal handlePortalUnmount() |
Thanks much, this is enough for us to fix it 👍. Whoever picks this up, we need to remove use of /**
* Returns true if a root node contains another node.
* @param {DOMElement} root The root that is expected to contain the node
* @param {DOMElement} node The node to look for in root
* @returns {boolean} Whether or not root contains the node
*/
export const rootContainsNode(root, node) {
// traverse node parents, if we reach the root then the node was in root
while (node) {
if (node === root) return true
node = node.parentNode
}
return false
} |
@levithomason - I think the issue raised here is that The issue may be with firstElementChild although it seems to be supported on all modern browsers. It's used to set the portal here: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/addons/Portal/Portal.js#L333 FWIW |
Thanks, I looked right over this in the OP: From a quick scan around the web, it looks like the fix may be as simple as: -this.portal = this.node.firstElementChild
+this.portal = this.node.children[0] |
I'll test it on windows PC today, if last comment solves problem, I'll make PR. |
The OP noted this error |
It's output of I've added some debug to + debug('handleDocumentClick(): start')
// If event happened in the portal, ignore it
if (this.portal.contains(e.target)) return If we look on IE debug, it becomes clear that problem is in event calling, not in So, main question there is why IE calls |
Ah, I see. I may have to drag out the old windows box at some point to debug. It would also be good to get some tests going in multiple browsers / platforms. I'll add these to my bucket list, won't be soon though! |
@levithomason As temporary fix we can make this change: + // Temporary fix for IE
+ if(!this.portal) return
// If event happened in the portal, ignore it
if (this.portal.contains(e.target)) return |
I've made some updates and added your suggestion, see #823. |
I'll pull branch with fix and test it IE today. |
Modals aren't working for me in I.E. 11, it shows the dimmed background, then no actual modal. |
Please open a new issue and include as much information as possible. There is a template shown when you create an issue. |
I'm receiving the following error when I close the modal window through a button click event in IE.
"Unable to get property 'contains' of undefined or null reference"
I do not receive any error if i close the modal by clicking outside of it though.
I'm using the latest version of semantic-ui-react and my version of IE is Version 11.0.9600.18500
The text was updated successfully, but these errors were encountered: