You need to sign in to do that
Don't have an account?
David Picksley
'Unload' static resource stylesheets when closing the component it is called from
We have a custom lightning component that takes advantage of an external stylesheet (stored in the static resources).
It is included with
My thinking is that the developer adds a sort of 'onExit' handler to unlink the file, but I can't find any documentation for unloading a static resource, or I could be completely wrong and it just be a caching issue
The issue is that some of the styles in that external resource are being carried over to other components that don't explicitly include the file
How can we tackle this?
A screen recording of the issue
It is included with
<ltng:require styles="{! $Resource.STYLESHEETNAMEHERE}"/>
My thinking is that the developer adds a sort of 'onExit' handler to unlink the file, but I can't find any documentation for unloading a static resource, or I could be completely wrong and it just be a caching issue
The issue is that some of the styles in that external resource are being carried over to other components that don't explicitly include the file
How can we tackle this?
A screen recording of the issue
- Open a default modal (FINE)
- Open a custom component that includes the CSS file named 'fullModalBypass.css'
- Re-open the first modal, the modal contains the CSS file that was included in the component of the previous step
Naveen
All Answers
Naveen
For anyone running into the same problem. We have found a workaround. You can do the following: