Skip to content

Conversation

@kmichalikk
Copy link
Contributor

@kmichalikk kmichalikk commented Dec 23, 2025

Closes https://github.com/software-mansion/react-native-screens-labs/issues/598

Description

This PR aims to generalize the condition in RNSScreenShadowNodeCommitHook to also include the screen resize, without orientation change. Let's discuss the change & decide how "general" should it be.

Even when triggering the mechanism on every screen resize, this shouldn't be a problem, since the change is still rare.

Changes

Modified the screen size reset condition in RNSScreenShadowNodeCommitHook

Before & After

Before After
no-commit-hook-refactor.mov
after-commit-hook-refactor.mov

Test code and steps to reproduce

Use Test2933 & try split screen, floating window.

@kmichalikk kmichalikk changed the title feat: Make commit hook condition for resetting screen size more general feat(Android): Make commit hook condition for resetting screen size more general Dec 23, 2025
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Hmm, this one is interesting and I'll revisit it.

I'm not sure whether we want to zero the shadow node state every single time when the screen dimensions change.

I'll look into it after new year. Thanks for the PR.

@kmichalikk kmichalikk force-pushed the @kmichalikk/explicit-orientation-vs-resize-screen-commit-hook-android branch from dafcc55 to d8ce849 Compare January 21, 2026 14:58
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

The code looks good.

I need you however to confirm, that we're not fixing only a whiteboard problem. Let's try to lay our hand on some fold device & actually see whether there indeed is something to fix.

@kmichalikk
Copy link
Contributor Author

I updated the description. It's actually easy to see on the android tablet emulator.

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Great, thank you!

Let's proceed.

In case anyone needs to disable this change, you can do it by setting this flag to false in the top level scope of you app, similarly as it is done here.

@kmichalikk kmichalikk merged commit 2eed7d3 into main Jan 22, 2026
7 checks passed
@kmichalikk kmichalikk deleted the @kmichalikk/explicit-orientation-vs-resize-screen-commit-hook-android branch January 22, 2026 11:26
@t0maboro
Copy link
Contributor

I'm observing the regression that the ScreenContentWrapper's size doesn't match Screen's size and the content is misaligned, starting from this commit.

Before:
before

After:
after

Could you check that?

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