Skip to content

feat: add onRequestClose to ModalBottomSheet - #70

Draft
DanyKrk wants to merge 38 commits into
software-mansion-labs:mainfrom
DanyKrk:onRequestClose
Draft

feat: add onRequestClose to ModalBottomSheet#70
DanyKrk wants to merge 38 commits into
software-mansion-labs:mainfrom
DanyKrk:onRequestClose

Conversation

@DanyKrk

@DanyKrk DanyKrk commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

DanyKrk added 26 commits August 20, 2026 19:15
  Register Back and Escape handlers lazily when onRequestClose is first
  provided, then preserve their ordering by toggling eligibility instead
  of re-registering them.

  Reset registrations at structural host boundaries and add coverage for
  lifecycle changes, multiple sheets, predictive Back, and handler removal.
  Supersede unfinished presses on a new initial key-down and retain
  short-lived tombstones so late events cannot finish the replacement.
Publish portal ownership and emission eligibility as a single state snapshot.
Keep handlers stable while inactive portals yield new Back and Escape requests
without retargeting input already in progress.

Expand lifecycle, ownership, and controlled-dismissal coverage and update docs.
- remove redundant request-close handling updates
- replace reflection-based assertions with explicit test snapshots
- focus Robolectric coverage on platform-specific SDK paths
- simplify bottom sheet rendering
…andler

Forward Back to the host Activity and leave Escape in normal key routing when onRequestClose is omitted. Keep predictive Back actions pinned for the full gesture and ignore commits delivered after overlay teardown.

Expand unit and instrumented coverage and update docs and examples.
Keep eligibility loss terminal for the current Escape sequence, even if the handler or modal state is restored before key-up. Reuse the shared dispatcher state for portal and native-overlay handling.
Keep portal and native-overlay presentations as close-input boundaries while visible close animations settle, consuming Back and Escape without
emitting another onRequestClose.

Unify request, consume, and pass-through transport states, stabilize predictive Back handling, and update tests, examples, and documentation.
@DanyKrk
DanyKrk marked this pull request as draft August 20, 2026 17:31
@DanyKrk DanyKrk changed the title On request close Add onRequestClose prop Aug 20, 2026
@DanyKrk DanyKrk changed the title Add onRequestClose prop feat: add onRequestClose to ModalBottomSheet Aug 20, 2026
- track closing presentation through a production state tracker
- verify controllers through observable input routing and window flags
- cover close-animation ownership with an instrumentation test
Rename request-close state, routing, lifecycle, and presentation symbols
to reflect their actual responsibilities. Align the native bridge, tests,
and documentation with the updated terminology.
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.

[Feature request] Add onRequestClose callback to normalize Android back and ESC key handling

1 participant