Skip to content

Replace DropdownMenu with inline Card for address predictions - #13699

Merged
nidhi-stripe merged 6 commits into
masterfrom
nidhig/address-inline-autocomplete-dropdown-ui-fix
Aug 3, 2026
Merged

Replace DropdownMenu with inline Card for address predictions#13699
nidhi-stripe merged 6 commits into
masterfrom
nidhig/address-inline-autocomplete-dropdown-ui-fix

Conversation

@nidhi-stripe

@nidhi-stripe nidhi-stripe commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the floating DropdownMenu popup with an inline Card component for address autocomplete predictions

Motivation

The DropdownMenu (popup) approach had positioning and sizing issues, it required manual width tracking via onSizeChanged and used popupProperties(focusable = false) to avoid stealing focus. It would overlap with the keyboard.
An inline Card rendered directly below the text field in a Column is simpler, more predictable, and avoids popup layering/clipping problems.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Changelog

@cttsai-stripe cttsai-stripe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have some behavior changes along side with the swapping of the UI component. If they are needed, consider extracting them as a separate PR.

…ction

When a user taps a prediction, the text field loses focus (since clickable
elements are focusable in Compose), which triggered onDismissed() and
cancelled the selectionJob before fetchPlace could return. Now onDismissed
skips cancellation when a selection is actively in progress.

Committed-By-Agent: claude
Keep the UI component swap (DropdownMenu → Card, Box → Column) with
identical content and behavior inside. Controller logic, focus dismissal,
loading optimization, and layout reorg will follow in a separate PR.

Committed-By-Agent: claude
@nidhi-stripe
nidhi-stripe force-pushed the nidhig/address-inline-autocomplete-dropdown-ui-fix branch from 294b956 to 5e075fe Compare August 3, 2026 18:27
Committed-By-Agent: claude
@nidhi-stripe
nidhi-stripe marked this pull request as ready for review August 3, 2026 19:11
@nidhi-stripe
nidhi-stripe requested review from a team as code owners August 3, 2026 19:11
Comment on lines 147 to +148
currentCoroutineContext().ensureActive()
if (_inlinePredictionsState.value == AutocompleteAddressInteractor.InlinePredictionsState.Idle) return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc, we call ensureActive() somewhere else. Should we combine these two check and make it a helper? Ignore this comment if that is not true.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they serve different purposes, one checks selectionJob cancellation (no Idle guard needed), line 147 checks collectLatest cancellation + the Idle-state race guard so they can't be merged

@nidhi-stripe
nidhi-stripe enabled auto-merge (squash) August 3, 2026 19:19
Committed-By-Agent: claude
@nidhi-stripe
nidhi-stripe merged commit dd1e1f4 into master Aug 3, 2026
49 checks passed
@nidhi-stripe
nidhi-stripe deleted the nidhig/address-inline-autocomplete-dropdown-ui-fix branch August 3, 2026 20:08
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.

2 participants