Skip to content
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

Table component is broken on webkit #1531

Closed
gama opened this issue Aug 28, 2015 · 7 comments · Fixed by #2904
Closed

Table component is broken on webkit #1531

gama opened this issue Aug 28, 2015 · 7 comments · Fixed by #2904
Labels
component: table This is the name of the generic UI component, not the React module!

Comments

@gama
Copy link

gama commented Aug 28, 2015

To reproduce: go to the table demo page using Safari (or another webkit based browser, such as PhantomJS). The page won't render, and you'll see the following message on your console:

ReferenceError: Can't find variable: Symbol
@CumpsD
Copy link
Contributor

CumpsD commented Aug 28, 2015

Having the same issue on IE Edge

Symbol is undefined

Happening here:
https://github.com/callemall/material-ui/blob/master/src/table/table.jsx#L87-L89

Transpiled to:

  try {
      for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var child = _step.value;

@CumpsD
Copy link
Contributor

CumpsD commented Aug 28, 2015

Seems to come down to: babel/babel#1534

@CumpsD
Copy link
Contributor

CumpsD commented Aug 28, 2015

import 'babel/polyfill'; at my entry point solved the issue for IE

@timuric
Copy link
Contributor

timuric commented Sep 29, 2015

Added pull request #1755

@SergeBredin
Copy link

A require on core-js is enough, no need to install Babel actually
window.Symbol = require('core-js/modules/es6.symbol');
window.Symbol.iterator = require('core-js/fn/symbol/iterator');

@iwang
Copy link

iwang commented Oct 25, 2015

in my case I just add below in the first line of entry point.
import 'babel-core/polyfill';

@STRML
Copy link
Contributor

STRML commented Jan 12, 2016

No reason to use for/of here, React.Children.forEach works correctly and has no external dependencies.

Additionally, if there is only a single child (say, <TableBody> without a <TableHead>), children is an object, which is not iterable without Object.entries(), which requires another shim.

STRML added a commit to STRML/material-ui that referenced this issue Jan 12, 2016
We can't assume `children` is an array, as it is a single
element when only one child is passed.

Fixes mui#1531, mui#1972, mui#2058 and removes need for a Symbol
polyfill.
mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
…l/runtime-7.8.4

Bump @babel/runtime from 7.8.3 to 7.8.4
@zannager zannager added the component: table This is the name of the generic UI component, not the React module! label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants