Closed TerdyTheTerd closed 1 year ago
PS* The reason it's not styled in the above screenshot is because the styling is only loaded on the page where it's supposed to be used, this is from a completely unrelated page where the element still exist when it shouldn't. Force reloading removes it, but once again, not ideal as that prevents any caching.
When you say "navigating to different pages" I'm assuming you don't mean actually navigating away to a physical page, but rather some framework's (React?) interpretation of page where the new content is injected in some element (body?) on demand.
Unfortunately there is no way for me to know when such action might happen, so you will have to keep doing it manually. I generally do not try and support some framework or the other.
Weird to not support React, when all it needs is proper methods to remove itself from the page so the onDestroy method can call that to clean it up...but I'll close this out since I have a manual solution.
@TerdyTheTerd can you post your destroy method for us other React users to see please?
The Coloris element remains in the DOM when navigating to different pages, this is why an onDestroy is required so we can properly remove this and prevent it from existing past when it's supposed to.
My manual solution in the meantime, if I want to use this library, is I have to call a function to delete this element on every page at startup, which is not ideal in the slightest.