-
Notifications
You must be signed in to change notification settings - Fork 3
Cannot read property 'insertAdjacentElement' of undefined #24
Comments
Hello @allahyar can you provide more context about your problem? A stackblitz link would bring more clarity |
Hi TL; DRPass the <div ngxSticky [triggerOn]="'text-content'">
Sticky Title
</div>
<div id="text-content">
Text
</div> We found the problem of that bug, it's because Ivy, we have 3 options to solve the error:
<div ngxSticky [triggerOn]="'text-content'">
Sticky Title
</div>
<div id="text-content">
Text
</div> Ivy changed something about how we pass parameters. There is an issue open about it According to Ivy Compatibility guide
<div ngxSticky [triggerOn]="textContent">
Sticky Title
</div>
<div #textContent>
Text
</div>
{
"compilerOptions": {...},
"angularCompilerOptions": {
"enableIvy": false
}
} |
We will close this issue after adding this note to the README as part of the documentation and deploy library (so the doc is updated there too). |
Hi @yossely, I found this issue via angular/angular#34227 and I am trying to piece together an ivy directive myself: https://github.com/METACEO/ng-transition While I believe we're facing the same issue, I'm experimenting with your first recommendation and I'm not having any luck (against my own directive) and our directive's internals look the same: Does your first recommendation work for you?.. or are you proposing it as a change? |
Hi @METACEO, yes, we're facing the same issue and yes, my first recommendation works in my case, passing the string property as In my case, I wanted to get an element by |
I unfortunately begin to receive a A demo of the error: https://stackblitz.com/edit/angular-ivy-rlsxgb?file=src%2Fapp%2Fapp.component.html And I look my directive's source and it looks identical to ngx-sticky (in terms of I don't know if this is the same for Thank you @yossely for verifying that your first recommendation works, I'll work towards that!
|
@yossely I believe I've determined that my issue was the conditional template I was rendering with the After reading the "Ivy compatibility examples" page, I think the conditional template was interfering with the attributes being set. It wasn't the change I was hoping to find, but it should make due in the meantime. Your first recommendation works just well for me! Thank you again for the support and replying earlier! |
@METACEO you're welcome! Glad to hear that you could solve it too 👍 |
Angular : 9.0.1
ngx-sticky-directive : 1.2.8
The text was updated successfully, but these errors were encountered: