Skip to content

Commit f2d74b3

Browse files
authored
fix: KeyboardExtender initial mount on Fabric (#1135)
## 📜 Description Fixed initial display of `KeyboardExtender` on Fabric (potentially iOS 26 specific only). ## 💡 Motivation and Context When view is initially mounted, then `oldProps.enabled` and `newProps.enabled` will be `true`, so we'll never update `_enabled` (the only one case is to set it to `false` and then back to `true` on JS). This fix is similar to #1040 - we don't need to rely on old props and instead we need to compare with our own internal state. Closes #1133 ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### iOS - change `if (newViewProps.enabled != oldViewProps.enabled) {` to `if (newViewProps.enabled != self.enabled) {` ## 🤔 How Has This Been Tested? Tested on iPhone 16 Pro (iOS 26). ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<img width="1206" height="2622" alt="image" src="https://github.com/user-attachments/assets/f0167f56-d069-4d27-8a44-b4cdb061a01b" />|<img width="1206" height="2622" alt="image" src="https://github.com/user-attachments/assets/fa290038-7d5e-45f4-8c95-81ac6d75d313" />| ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 0a97fd6 commit f2d74b3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ios/views/KeyboardExtenderManager.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,9 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
222222
#ifdef RCT_NEW_ARCH_ENABLED
223223
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
224224
{
225-
const auto &oldViewProps = *std::static_pointer_cast<const KeyboardExtenderProps>(_props);
226225
const auto &newViewProps = *std::static_pointer_cast<const KeyboardExtenderProps>(props);
227226

228-
if (newViewProps.enabled != oldViewProps.enabled) {
227+
if (newViewProps.enabled != self.enabled) {
229228
[self updateEnabledState:newViewProps.enabled];
230229
}
231230

0 commit comments

Comments
 (0)