question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow popover content to be lazily instantiated

See original GitHub issue

Hey!

I’ve noticed that if you have a component as your sat-popover content, that the component is actually initialized, even though the popover isn’t opened yet.

At first I thought this was a regression based on this comment you made from a previous conversation we had, but I was playing around on StackBlitz and rolled back a few versions and saw the same behaviour regardless.

Demo of issue: https://stackblitz.com/edit/sat-popover-issues-vicsu1

You can see that the ngOnInit of the popover-content component is called even before the button is clicked to display it.

This is an issue for us because our popover content component makes an http request. So the request is being made even before the user has shown any interest in viewing that content.

We can easily work around it by using the isOpen() method combined with *ngIf, but I thought I’d mention the issue since it seems like from your previous comment this behaviour may not be intended.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
julianobrasilcommented, Apr 8, 2020

I’ll take a look at them and give it a try. I’ll come back to you in case of trouble with the overall process.

0reactions
isaackehlecommented, Apr 8, 2020

No, I mean I tried building locally from scratch some of the different PRs, some things not working. The workaround you mentioned talked about some of the code being merged w/o proper tests, so it seems there’s an opportunity to add another PR to fix a couple of these issues. Looking for some help with that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using a Lazy Load inside a popover - Stack Overflow
It's because normal lazyloader are only re-acting to scroll events and only with static content. Use lazySizes (github.com/aFarkas/lazysizes), ...
Read more >
Popovers - Bootstrap
Popovers are opt-in for performance reasons, so you must initialize them yourself. Zero-length title and content values will never show a popover. Specify ......
Read more >
Make Your Angular Directive Functionality Lazy - Netanel Basal
It can be used as a tooltip or popover , and is themable, fast, strongly typed, accessible, and more. Let's wrap it with...
Read more >
All Props | Tippy.js - GitHub Pages
Prop Default Description plugins Specify plugins to use. See Plugins for details. role "tooltip" Specifies the role attribute on the tippy element. zIndex 9999 Determines the...
Read more >
React Tooltips & Popovers with Bootstrap 5 Examples
The only difference is that the Popover contains much more content than a tooltip. Install New React App. Before we go any further,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found