Commit 5b0b4c3
authored
fix: attaching
## 📜 Description
Fixed mounting `KeybaordExtender` when switching `enabled` from `false`
to `true`.
## 💡 Motivation and Context
When initial `enabled={false}` and then we switch it to `true`, then
this code:
```tsx
if (_sharedInputAccessoryView) {
if (!enabled) {
[self detachInputAccessoryView];
} else {
// Re-attach if a text input is active
UIResponder *firstResponder = [UIResponder current];
if ([firstResponder conformsToProtocol:@protocol(UITextInput)]) {
[self attachToTextInput:(UIView *)firstResponder];
}
```
Will never be executed. Because `_sharedInputAccessoryView` is `nil`
(it's initialized in `attachInputAccessoryViewTo`).
To fix this bug I simply removed `if (_sharedInputAccessoryView)`
condition - it should work without it too 🙂
Closes
#1056
## 📢 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
- removed `if (_sharedInputAccessoryView)` condition;
- cleanup `KeyboardExtenderContainerView` file;
## 🤔 How Has This Been Tested?
Tested manually on iPhone 15 Pro (iOS 17.5).
## 📸 Screenshots (if appropriate):
https://github.com/user-attachments/assets/6ffc5462-6425-4d32-bef0-99e1f37c06a8
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changedKeyboardExtender (#1065)1 parent 93a55c1 commit 5b0b4c3
2 files changed
Lines changed: 7 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
109 | | - | |
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
| |||
0 commit comments