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.

Add originalEvent to eventListeners

See original GitHub issue

Add originalEvent to bootstrap eventListeners like hide.bs.dropdown, if support it.

I need to know, which element was clicked, before a dropdown was closed. I tried to add this code to the Dropdown._clearMenus function in dropdown.js file (after the definition of the relatedTarget variable).

if (event) { relatedTarget.original = event.originalEvent; }

This code snippet make the originalEvent accessible from the hide.bs.dropdown event. For other events may be used similar way.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Johann-Scommented, Apr 18, 2018

Hmm ok, understood thanks 👍

0reactions
Johann-Scommented, Apr 19, 2018

When I’ll have time to work on that @ondrajodas, but every issues are open, so if someone want to fix this issue he should do it 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

EventTarget.addEventListener() - Web APIs | MDN
The method addEventListener() works by adding a function, or an object that implements EventListener , to the list of event listeners for ...
Read more >
Adding event listeners to current and future elements with a ...
this basically adds a click event listener to the #myWrappingElement element, and jquery will automagically look to see what the original event ......
Read more >
.on() | jQuery API Documentation
Description: Attach an event handler function for one or more events to the selected elements. version added: 1.7.on( events [, selector ] [,...
Read more >
Simple Custom Event Listeners With Google Tag Manager
How to create simple custom event listeners with Google Tag Manager. You can track any user interaction on the site with this solution....
Read more >
Events - Polymer Project
Add event listeners to the host element by providing a listeners object that ... In this example, the original event is triggered on...
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