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

Avoid "dataset" in dom data getter and setter #1187

Closed
mattsahr opened this issue Jul 23, 2015 · 4 comments
Closed

Avoid "dataset" in dom data getter and setter #1187

mattsahr opened this issue Jul 23, 2015 · 4 comments

Comments

@mattsahr
Copy link

Internet Explorer 10 and below can't use "dataset" to access data on a DOM element. Here's a fix for the mdlComponentHandler.js file.

ORIGINAL

var upgrades = component.element_.dataset.upgraded.split(',');
var componentPlace = upgrades.indexOf(
    component[componentConfigProperty_].classAsString);
upgrades.splice(componentPlace, 1);
component.element_.dataset.upgraded = upgrades.join(',');

UPDATED

var upgrades = component.element_.getAttribute("data-upgraded").split(',');
var componentPlace = upgrades.indexOf(
    component[componentConfigProperty_].classAsString);
upgrades.splice(componentPlace, 1);
component.element_.setAttribute("data-upgraded", upgrades.join(','));
@surma
Copy link
Contributor

surma commented Jul 23, 2015

Confirmed. IE10 does not support dataset.

@surma surma self-assigned this Jul 23, 2015
@Garbee
Copy link
Collaborator

Garbee commented Jul 23, 2015

Whoops, we also have problems in the component handler then... thanks for pointing this out.

@Garbee
Copy link
Collaborator

Garbee commented Jul 23, 2015

Oh, I think Surma may have mis-tagged this... I have patch for the problem in with PR #1190.

@surma
Copy link
Contributor

surma commented Jul 23, 2015

My bad. Brain lag.

@Garbee Garbee closed this as completed Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants