IE 8, 9 throwing error on insert
IE 8 & 9 are throwing an error "Invalid argument." on line 1838. I tracked it down the the target variable being undefined, when calling self._$parent[0].insertBefore(frag, target). I fixed by adding a default to the variable:
target = (function(){
self._refresh();
if(self._$targets.length){
return (args.index < self._$targets.length || !self._$targets.length) ?
self._$targets[args.index] :
self._$targets[self._$targets.length-1].nextElementSibling;
} else {
return self._$parent[0].children[0];
}
})() || null;
I'm not 100% sure if that's the root of the problem, but works for me. Would love to see in a future release, I can submit a pull request, if that'd help.
Hi guys,
are there any updates about this topic? I faced the same issue in IE 10 and don't know whats going wrong … :(
Thanks and best, Chris
@aufdenpunkt || null was added at the end of the function in the mixitup.js file to fix this problem as @plankguy has posted. This worked for me in IE 10.
You need to add it to this function
target = (function(){ self._refresh();
if(self._$targets.length){
return (args.index < self._$targets.length || !self._$targets.length) ?
self._$targets[args.index] :
self._$targets[self._$targets.length-1].nextElementSibling;
} else {
return self._$parent[0].children[0];
}
})();
so it becomes:
target = (function(){ self._refresh();
if(self._$targets.length){
return (args.index < self._$targets.length || !self._$targets.length) ?
self._$targets[args.index] :
self._$targets[self._$targets.length-1].nextElementSibling;
} else {
return self._$parent[0].children[0];
}
})() || null;
Awesome, thanks. Is it possible to add this also in your source? I'm using bower to install all the dependencies and currently I have to use my forked repository of your library, where I fixed this for myself. But in general I prefer to use the repository of the contributor. :)
This should no longer be an issue in MixItUp 3. Let me know if you continue to have any issues thought. https://github.com/patrickkunka/mixitup/releases/tag/v3.0.0