Skip to content

Comments

Fix LocalDensity propagation into ComposeScene layers#2527

Merged
svastven merged 12 commits intojb-mainfrom
svastven/bugfix/modified-local-density
Oct 28, 2025
Merged

Fix LocalDensity propagation into ComposeScene layers#2527
svastven merged 12 commits intojb-mainfrom
svastven/bugfix/modified-local-density

Conversation

@svastven
Copy link

@svastven svastven commented Oct 26, 2025

LocalDensity from the parent composition did not flow correctly into newly created compose scenes (Dialog/Popup) on iOS causing interaction and rendering issues. This PR fixes the bug by separating screen density (from the platform) and scene density (the current composition’s LocalDensity) in ComposeSceneMediator. This PR also aligns iOS with Android. On Android Dialog and Popup do not inherit LocalDensity from the parent but re-seed density from the platform. On Desktop layers do inherit LocalDensity from the parent.

Fixes CMP-8662 [iOS] Incorrect tap responses in a Dialog when LocalDensity is modified.

Testing

  • Adds LocalDensityTest test suite
  • Adds tests to KeyboardInsetsTest
  • Adds tests to ScrollTest

This should be tested by QA

Release Notes

Fixes - iOS

  • Fix incorrect tap responses in Dialog when LocalDensity is modified

@svastven svastven marked this pull request as ready for review October 26, 2025 18:07
@svastven svastven requested a review from ASalavei October 28, 2025 08:50
@svastven svastven requested a review from ASalavei October 28, 2025 11:41
@svastven svastven merged commit f79f063 into jb-main Oct 28, 2025
16 checks passed
@svastven svastven deleted the svastven/bugfix/modified-local-density branch October 28, 2025 12:51
@benkuly
Copy link

benkuly commented Jan 2, 2026

On Android Dialog and Popup do not inherit LocalDensity from the parent but re-seed density from the platform. On Desktop layers do inherit LocalDensity from the parent.

Why is there a difference at all? We're really confused, that the LocalDensity is NOT passed to Dialog/Popup content on all platforms.

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.

4 participants