Skip to content

Research: Escape Key Handling for Nested Modals/Popovers #21650

@sangeethababu9223

Description

@sangeethababu9223

Problem

When popovers (OverflowMenu, Toggletip, etc.) are nested inside Modal/ComposedModal, pressing Escape doesn't follow expected behavior. Ideally, it should close the topmost element (popover) first, then the modal. Currently, behavior is inconsistent - in some cases like OverflowMenu, only the Modal closes, leaving the menu open without its trigger button.

Goal

Find a solution for proper escape key and click-outside behavior when popovers are nested inside modals.

Scope

  1. Test component combinations - Identify which components are affected when placed inside Modal: OverflowMenu, Toggletip etc.
  2. Evaluate solutions:
  • Registration model for tracking modal/popover stack (concerns: backwards compatibility, complexity)
  • Simple refactoring opportunities in existing components
  • Platform-based approaches (dialog + Popover API)
  1. Define expected behavior - Should Escape close both or topmost first?

Deliverables

  • Component behavior matrix showing current issues
  • Recommended solution approach with implementation considerations
  • Any quick wins that can improve current state

Metadata

Metadata

Type

No fields configured for Spike.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions