Last active
March 3, 2017 16:14
-
-
Save tuckbick/dfa7ff8c949813f895f514856ef9cd8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
// ... | |
// It can 20-30 milliseconds for CSS to be applied to the newly | |
// inserted DOM. This attempts to wait for that. | |
// Gives up after 200 * 10 milliseconds = 2 seconds to be safe. | |
interval = window.setInterval(() => { | |
intervalAttempts++; | |
if (intervalAttempts > 200 || view.$el.height() > 1) { | |
clearInterval(interval); | |
view.afterRender(); | |
} | |
}, 10); | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment