-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Fix backdrop rootElement
not initialized in Modal
#33853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@boddunan Seems a nice solution, but I suppose it would be more valid to solve the root of the problem on do you want to give it a try? |
Thank you @GeoSot for the feedback. Intializing rootElement with document.body before the document loaded would fail anyway. We have 3 options to fix it as far as I think. Please suggest.
Maybe there is some other good alternative, please let me know. |
Probably I would choose the No2 ( |
Thanks. I changed the fix to use method 2. Considering the critical nature of the issue, I would like to fix the issue asap and then apply changes from the other PR when it is merged. |
Something like this, would be more streamlined with the rest code base _getConfig(config) {
config = {
...Default,
...(typeof config === 'object' ? config : {})
}
config .rootElement = config .rootElement || document.body
..... (rootElement in line 14 better to be null) Plus, at least a test |
Done. Added tests and moved the intiialization part to _getConfig |
rootElement
not initialized in Modal
Fixes #33840
The backdrop rootElement is not initialized when the javascript file loaded in the document head as the document.body is not yet initialized and Default variable in backdrop.js is loaded before it.