Skip to content

Conversation

@kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Sep 8, 2025

📜 Description

Use window size instead of screen.

💡 Motivation and Context

Originally I added code in #948 (used subscription on screen instead of window). In #957 I realized that new approach has downsides and started to use layoutSubviews method instead of subscription to events that apple provides (and I kept using screen size as main source of truth). However on iPad in multi-task/stage-manager mode screen size may not reflect a real window size (because if window is floating it can be much smaller than the screen).

So in this PR I'm refining solutions made in #948 and #957. We still need to use window as main source of truth and we need to read it in layoutSubviews because new dimensions may not be available in events that we receive from notification center.

I tested repo provided in #948 and #957 and with new code they still seem to work well:

948 957
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-09-08.at.17.24.03.mp4
Simulator.Screen.Recording.-.iPad.Pro.11-inch.M4.16GB.-.2025-09-08.at.17.27.25.mp4

Closes #1045

📢 Changelog

JS

  • read window dimensions instead of screen;

iOS

  • use self.window instead of UIScreen.main;

🤔 How Has This Been Tested?

Tested manually on iPad 11 Pro (m4, 16GB, iOS 18.5).

📸 Screenshots (if appropriate):

Before After
image image

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Sep 8, 2025
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🍎 iOS iOS specific KeyboardExtender 🧩 Anything about keyboard extending (i. e. `KeyboardExtender` component) labels Sep 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

📊 Package size report

Current size Target Size Difference
212978 bytes 212955 bytes 23 bytes 📈

@kirillzyusko kirillzyusko force-pushed the fix/keyboard-extender-width-in-ipad branch from 9eaef00 to 32f491a Compare September 8, 2025 14:34
@kirillzyusko kirillzyusko marked this pull request as ready for review September 8, 2025 14:34
@kirillzyusko kirillzyusko merged commit 2a3bcee into main Sep 8, 2025
18 checks passed
@kirillzyusko kirillzyusko deleted the fix/keyboard-extender-width-in-ipad branch September 8, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working 🍎 iOS iOS specific KeyboardExtender 🧩 Anything about keyboard extending (i. e. `KeyboardExtender` component)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyboardExtender width is broken on iPadOS for multi-task/stage-manager modes

2 participants