feat: make sure DOM has loaded before accessing #612
Closed
+27
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modularity is working great out of the box. However I noticed that when adding a custom plugin I caused the DOM to load slightly slower. This causes the modal.ts of Modularity to try to access it before loaded which causes a crash.
This might only be an issue on our end (Whitespace) due to our custom plugins. However I thought I'd make a PR since I don't think this change would have any negative side effect.
What it does is to add a DOMContentLoaded event listener to make sure the DOM is available before access attempt in the constructor.