Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Popover with template flickers on first open #4639

Closed
mihaibogdan10 opened this issue Oct 15, 2015 · 5 comments
Closed

Popover with template flickers on first open #4639

mihaibogdan10 opened this issue Oct 15, 2015 · 5 comments

Comments

@mihaibogdan10
Copy link

I'm using 0.14.2, but I've tested it and I have the same issue with master.

I find that simplest way to explain this is to show it. For a split second, the popover is positioned at the top-right corner of the element that shows/hides it. This only happens the first time I open it, however.

screen shot 2015-10-16 at 12 01 14 am

(I was only able to get a picture of the above by recording and playing in slow-motion)

All subsequent opens are correctly positioned.

screen shot 2015-10-16 at 12 01 24 am

I was able to showcase it in a plnkr, you can clearly observe the initial flickr, although the behavior is different: http://plnkr.co/hRJNKJGo6gaDFBmoPEMa

@wesleycho
Copy link
Contributor

@RobJacobs know of what might cause this? Sounds related to the tooltip positioning

@RobJacobs
Copy link
Contributor

Here is a plunk with the latest build from master that includes PR #4623 which behaves better. What you are seeing is the delay for the template to be loaded into cache then the popover sizing to fit that content. You don't see that again because the template's been cached. I added an example of an inline (local) template and you will notice there is no 'flash'.

@mihaibogdan10
Copy link
Author

I'm afraid my use case prevents me from using inline templates, as I need to use the same one across a lot of different views.
Is it possible to wait for the template to be loaded before displaying anything the first time it is opened?

@icfantv
Copy link
Contributor

icfantv commented Oct 16, 2015

@mihaibogdan10 you can register your template in the $templateCache at Angular boot time.

@wesleycho
Copy link
Contributor

Closing this issue as a support issue.

You should always bundle your templates in $templateCache before it potentially loads. Never load a template via xhr if you want to avoid weird flashes such as this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants