Semantic-ui-react: Portal: recent change breaks in IE11

Created on 6 Jun 2018  路  5Comments  路  Source: Semantic-Org/Semantic-UI-React

Bug Report

A change introduced in #2657 to the portal component causes an error in IE11 when trying to open anything using a portal.

The change:
https://github.com/Semantic-Org/Semantic-UI-React/blob/500df9ae073dc99b3425fda89fe6b3a3d8f56760/src/addons/Portal/Portal.js#L355

Steps

Use anything with a portal in IE11 and try to open it.

Expected Result

Should open the portal.

Actual Result

Throws the following error:

SCRIPT5045: Assignment to read-only properties is not allowed in strict mode

Which points to the changed line.

Version

[email protected]

bug

Most helpful comment

Will be fixed in #2880.

All 5 comments

Will be fixed in #2880.

@levithomason @layershifter per https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style you could probably fix this with one line of code by changing this this.rootNode.style = style || '' to this this.rootNode.cssText = style || '' or this this.rootNode.setAttribute('style', style || '')

Not sure how much more work is needed for #2880. Considering this bug is affecting all portals for a major browser, this quick fix might be worth doing if it's going to be more than a few more days.

I support an individual release of the fix. Currently my team is stuck with using version 0.80.2. Even if #2880 comes soon, it looks like a risky upgrade to do right after the release.

@mgandley @mihai-dinculescu Feel free to submit PR 馃憤

Done!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

layershifter picture layershifter  路  20Comments

dylankiss picture dylankiss  路  22Comments

cytey picture cytey  路  24Comments

anhdle14 picture anhdle14  路  20Comments

ryardley picture ryardley  路  27Comments