Skip to content

[MON-147500] Close Popover when outside controls stop click propagation - #43

Open
iu-glints wants to merge 1 commit into
glints-dev:mainfrom
iu-glints:fix/mon-147500-popover-outside-click
Open

iu-glints wants to merge 1 commit into
glints-dev:mainfrom
iu-glints:fix/mon-147500-popover-outside-click

Conversation

@iu-glints

Copy link
Copy Markdown

Why

Popover misses outside clicks when the clicked control stops propagation. This leaves the Employers account menu open above a candidate profile.

Task: MON-147500. Related Employers MR: !5017.

What changed

  • Enable capture on PopoverOverlay's existing click listener so it receives the click before target handlers can stop propagation.
  • Add a patch changeset for polaris-glints.

Scope

One listener setting. No new listeners, API changes, touch-handler changes, or committed UI tests. Existing business-logic tests are untouched.

Tradeoffs

The shared fix avoids duplicating outside-click listeners in consumers. Outside-click onClose now runs before target click handlers. Existing content, activator, child-overlay, and transition checks remain unchanged.

Blast radius

All Polaris Popover consumers receive the new click ordering after upgrading. Global EventListener defaults are unchanged. Aries and Employers are not upgraded by this PR. Keep the Employers workaround until the fixed dependency is released and adopted.

Verification

  • Real Chrome check with the current source PopoverOverlay compiled into the Polaris 15.12.0 supporting components used by Employers. Before: menuState=open, candidateOpened=true, closeCalls=0. After the same click: menuState=closed, candidateOpened=true, closeCalls=1. No production or shared staging data was changed.
  • Local browser checks pass for internal clicks, activator closing and reopening, normal outside clicks, protected nested menus, unprotected nested-menu actions still firing while the parent closes, and menu-owned dialog survival. Workspace build:types, focused ESLint, Prettier, and independent correctness and comment review pass.
  • Existing Popover, PopoverOverlay, and EventListener tests have the same 27 passing and 27 failing cases before and after. All failures require missing glints-portal-container setup. With a temporary, uncommitted portal setup, both versions have 50 passing and the same 4 failing cases: two stale fixed-ID expectations and two portal-container expectations. No new failures. Root typecheck fails because this fork references absent workspace packages; the affected workspace typecheck passes. This is not a green native test suite or deployed Employers verification.

Screenshots below show the same local real-component fixture, not a deployed Employers page. Images are hosted in the related GitLab project and may require Glints GitLab access.

Before After
Account menu remains open after candidate opens Account menu closes while candidate still opens

Follow-up

After maintainer review and package release, update the Polaris dependency in Aries, release Aries, upgrade Employers, and remove the UserMenu-specific listener and supporting hooks. No merge or package publication was performed as part of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant