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.

[Popover] Unable to remove overlay from popover

See original GitHub issue
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

I’m trying to add the ability to add other functionality to occur before the popover closes. The Popover component adds an overlay which detects any clicks then triggers the setAnchorEl method (updates the state to null.

I have a close button which I want to perform some behavior prior to the popover closing.

Expected Behavior 🤔

I expect there to be some flag on the popover api like: hideOverlay, similar to the Menu component. This would allow me to trigger the handleClick related to the close button before setting anchorEl to null.

Steps to Reproduce 🕹

Here is a basic repl which simply console.logs the order of operations. Steps:

  1. open popover
  2. click close button
  3. notice the order in which the logs are performed

Context 🔦

Your Environment 🌎

https://codesandbox.io/s/759bb?file=/demo.tsx

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eps1loncommented, Jun 18, 2021

I want to be able to simultaneously reset the value of the field and close the popover, when the close button is clicked.

What field do you mean? Could you highlight in your codesandbox what the “field” and its value is?

0reactions
akshitarora921commented, Sep 28, 2022

@maksimgm Any solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Popover] Unable to remove overlay from popover #26362
I'm trying to add the ability to add other functionality to occur before the popover closes. The Popover component adds an overlay which...
Read more >
React Material UI: How to prevent the Popover component ...
I am using Menu component to show up a menu when user hovers on an element. However, I noticed that when the menu...
Read more >
lightning:overlayLibrary popover styling - missing nubbin and ...
The nubbin in my popover is showing a white diamond instead of a blue arrow inspite of specifying 'slds-nubbin_left' class in cssClass attribute ......
Read more >
How to Dismiss a React-Bootstrap Popover on Click Outside
Another method to dismiss the popover is by using a different trigger event. You can use the hover or focus trigger instead of...
Read more >
Popovers - Presentation - Human Interface Guidelines - Design
A popover is a transient view that appears above other content onscreen when people click or tap a control or interactive area.
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