parent.getAttribute is not a function error
See original GitHub issueAfter debugging this issue i have come to find that parent
variable is being set to either Window or Document but neither of the two contain the getAttribute()
function.
This issue breaks my code and prevents the render of the component. I have defined my LazyLoad
component as so…
<div className={'Section6')}>
<LazyLoad height={333} offset={300} overflow once>
<Picture
image={sectionImage}
imageRetina={sectionImageRetina}
imageMobile={sectionImageMobile}
imageMobileRetina={sectionImage}
screen={SCREEN_SIZES.SCREEN_SM_MAX} />
</LazyLoad>
</div>
The parent div has a position: relative;
styling
Have I not used the overflow prop correctly? because it seems that although the overflow prop os set, the returned object in parent doesn’t contain the function which needs to be checked for the condition and therefore breaks at this point and throws an error.
Have i missed something?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15
Top Results From Across the Web
TypeError: abc.getAttribute is not a function - Stack Overflow
I get the error message: TypeError: abc.getAttribute is not a function . What have I done wrong? javascript · jquery.
Read more >TypeError: getAttribute is not a function in JavaScript
To solve the "getAttribute is not a function" error, make sure to call the getAttribute() method on a valid DOM element and place...
Read more >Uncaught TypeError: a.getAttribute is not a function
When the code updating the component attribute is removed, there's no error, but the delete button does not function as desired. Changing splice ......
Read more >Element.getAttribute() - Web APIs | MDN
The getAttribute() method of the Element interface returns the value of a specified attribute on the element.
Read more >getAttribute is not a function : r/learnjavascript - Reddit
I am trying to get an array of attribute id's using: frameList = document. getElementsByTagName('iframe').
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you please try
2.2.2
?hi @jasonslyvia and @yangg thanks for all your help, although since posting this issue i’ve changed the structure of the code and so i’m unable to check whether these solutions would work for me. but since refactoring I haven’t ran into any errors and found it works much better now.