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.

Is it possible somehow to listen events globally? For example, when popover is shown/hidden

See original GitHub issue

For example there is a popover with ref="myPopover". Is there any way to listen myPopover for such events as shown/hidden globally, something like addEventListener for shown and hidden methods?

From the source code seems that it is possible, but I do not understand how to connect to the internal event system in order to listen it.

I need to know if myPopover is shown/hidden far far away from a component where myPopover lives and I do not want to use vuex + @shown="callSomeFunction".

Thank.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
tmorehousecommented, Dec 7, 2018

You can listen for “global” events on the $root instance.

this.$root.$on('bv::popover::show', someHandler)
this.$root.$on('bv::popover::shown', someHandler)
this.$root.$on('bv::popover::hide', someHandler)
this.$root.$on('bv::popover::hidden', someHandler)
1reaction
tmorehousecommented, Dec 25, 2018

The events entry in component’s package.json is intended for events that the component emits itself, not for one’s that the component listens for.

We don’t have an official location, other than in the readme, for events the component may listen for (on root).

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Is there a way to listen for popovers hide being called ...
Try the hide event: $(document).on('hide.bs.popover', function() { console.log('popover hidden'); });. It's in the docs: http://getbootstrap.com/javascript/ ...
Read more >
Collapse | Components - BootstrapVue
'Global' $root instance events. Using $root instance it is possible to emit and listen events somewhere out of a component, where <b-collapse> is...
Read more >
Rally.ui.popover.OwnerPopover - Agile Central App SDK 2.1 ...
Create a popover to choose the owner of a specified record. ... An array of events that, when fired, should be bubbled to...
Read more >
NEWS
Now, if no Input binding element is found, the shiny:inputchanged event is triggered ... please set the global option options(shiny.snapshotsortc = TRUE) ....
Read more >
Susanne Wilding | SAP Fiori Design Guidelines
For an event end date, for example, the focus should propose a date in the ... You can add a footer with OK...
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