azazdeaz / azazdeaz/react-gsap-enhancer

Uncaught TypeError: t.removeAttribute is not a function

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
37
PR merge metrics
No merged PRs in 30d

Description

There seems to be an issue with this line:

```
Uncaught TypeError: t.removeAttribute is not a function
at _internals.CSSPropTween._setIEOpacityRatio [as setRatio]
at CSSPlugin.p.setRatio
at Object.p.render
at Function.TweenLite.to
at Object.p._init
at Object.p.render
at Object.p.render
at Object.Animation._updateRoot.TweenLite.render
at Object.p.dispatchEvent
```

The source from the CSSPropTween:

```
var _setIEOpacityRatio = function(v) {
var t = this.t, //refers to the element's style property
filters = t.filter || _getStyle(this.data, "filter") || "",
val = (this.s + this.c * v) | 0,
skip;
if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters.
if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) {
t.removeAttribute("filter");
skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check.
} else {
t.filter = filters.replace(_alphaFilterExp, "");
skip = true;
}
}
if (!skip) {
if (this.xn1) {
t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame.
}
if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues
if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween)
t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly.
}
} else {
t.filter = filters.replace(_opacityExp, "opacity=" + val);
}
}
};
```
Searching on the error yield this utils, but I doubt it's related...

https://github.com/azazdeaz/react-gsap-enhancer/blob/95e2a59e07d0ee933fd7b3e14216b10b7e38b67e/src/utils.js#L35

Browser: Chrome Version 58.0.3029.110 (64-bit)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the error in Chrome and trace the CSSPropTween._setIEOpacityRatio call shown in the report, checking what object t refers to when removeAttribute is invoked. The linked src/utils.js snippet may help compare related handling, but no repository test or specific reproduction is provided; done means identifying the failing input and demonstrating that the error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.