1

I am running some browser tests on Chrome and cannot find a particular popover in my codebase.

I figured I could snag its name or ID via manual inspect element, but it of course disappears when I try to right click it.

Without much identifying information to go by (unless I try js things with surrouding divs I suspect it might live in?), how can I get a handle on this element?

norman
  • 5,128
  • 13
  • 44
  • 75

2 Answers2

1

If it's a hover event that is triggered, in inspect element you should be able to force the state. Right click the code in your inspect element and you should see things like :hover and :focus and maybe :active. Just select whichever one triggers the event, and you should be able to view the code.

Jud
  • 1,324
  • 3
  • 24
  • 47
0

I found this useful when I needed to inspect a popover that disappeared on the next mouse click:

  1. Inspect the element that triggers the popover (in my case an <a> that shows the popover when you click on it).
  2. In the dev tools go to Elements view and, under there, Event Listeners.
  3. Expand the blur event using the little arrow to the left of it.
  4. Click "Remove" on any listeners under this event (or right-click and choose "Delete event listener". With no listeners for the blur event, the popover will no longer disappear when you click away from it.
  5. Trigger the popover as usual. It will now stay there while you inspect any elements within it.
Richard
  • 1,219
  • 11
  • 13