On widget init, the template's style should be set to display none. Otherwise it is invisible but occupies space at the top of the page and makes it impossible to interact with page elements underneath it. Once an alert gets shown and goes away, the container gets set to display none and the page can be interacted with.