Skip to content

Spam clicking an EuiPopover anchor will cause it to sometimes not close on outside click #8879

Closed

Description

@BryceRyan

Describe the bug

If you spam click a button (or any anchor, we had it happen with divs too) with an EuiPopover attached to it, it will sometimes get stuck open. Outside clicks do not close the popover anymore, the only way to close it is by clicking the button again.

I replicated this on multiple of the popovers on the "popover" page of the documentation

Impact and severity
Very Low

Environment and versions
EUI version 106.0.0, but seen on 55.x

Browsers: Firefox, Edge

Minimum reproducible sandbox
Any popover button on this page (as of v106.0.0) https://eui.elastic.co/docs/components/containers/popover/

To Reproduce
Go to the "How it works" button on the popover documentation page, spam click it. Ensure that when you are done spam-clicking, the popover is not closed. Now, click outside of the popover. The popover will not close. Now, click the "How it works" button one more time. The popover closes.

Note that I can only get it with about 75% success rate.

Expected behavior
The popover always closes on outside clicks if configured to do so.

Activity

  1. added
    ⚠️ needs validation
    on Jul 17, 2025
  2. added theissue type on Jul 17, 2025
  3. mgadewoll commented on Jul 18, 2025

    @mgadewoll
    Contributor

    Thanks @BryceRyan for reporting this!
    I can confirm this unexpected behavior. Clicking the popover too fast results in the popover not closing on outside click nor on Escape keypress, only on click of the trigger element.

    The internal states for isOpening and isClosing are not exclusive in rapid interactions due to them using timeouts. The code causing this is here.

  4. removed
    ⚠️ needs validation
    on Jul 18, 2025
  5. self-assigned this
    on Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions