Comments (16)
@gtokman could you please check whether #157 fixes the problem?
@kirillzyusko I had the same issue and applying the patch from your PR fixes the crash for me. Thank you 👍
from react-native-keyboard-controller.
Awesome @cgav Glad to know the fix is actually working!
I'm going to merge this PR within this week and prepare a new release, since it's quite impactful change 😎
from react-native-keyboard-controller.
@kirillzyusko it seems to be extremely rare - we had a few reports early on, so I wasn't sure at first. I'll bump the library to latest and report back 👍 Thanks for all of your help and work on this lib. It's been great!
from react-native-keyboard-controller.
@gtokman I guess it happens on latest version of the library, right?
As an intermediate solution I can suggest to revert back to 1.4.4
In a meantime I'll try to find a solution and provide a fix 🙂
from react-native-keyboard-controller.
@kirillzyusko yes, on the latest version of the library and 2.14 for reanimated.
from react-native-keyboard-controller.
@kirillzyusko Thanks for the info. I will downgrade for now and keep a close eye on this.
Feel free to tag me if there's anything I can do to help out.
from react-native-keyboard-controller.
@bcgilliom can you please test 1.11.0 and if it's still reproducible, then open a new issue? 🙏
And maybe you can shed some light on additional aspects, such as how frequently it happens, how much users are affected (in percentage, like 0.02% or smth like that), and maybe when it happens (maybe user navigated from modal screen to non-modal or something else)?
from react-native-keyboard-controller.
@gtokman could you please also tell more about how do you use the library and when this exception occurs?
How many KeyboardProviders
do you have? When this exception occurs (I guess when keyboard becomes hidden, but how long do you need to show/hide keyboard before you meet an exception? Maybe you see the exception when you switch between different type of keyboards (like number/alphabetical keyboard)?
from react-native-keyboard-controller.
@gtokman also, if you are able to test, could you please try to change:
keyboardView?.removeObserver(self, forKeyPath: "center", context: nil)
to
_keyboardView?.removeObserver(self, forKeyPath: "center", context: nil)
Just add _
to keyboardView
variable.
I have an assumption, that when we refer to keyboardView
it may re-run a process of finding a view and return a new instance without a listener 🤷♂️
from react-native-keyboard-controller.
@gtokman could you please check whether #157 fixes the problem?
from react-native-keyboard-controller.
FYI I'm also having this issue. I'm just using the KeyboardProvider in my App.tsx, and then in one place in my app:
React.useEffect(() => {
const show = KeyboardEvents.addListener('keyboardWillShow', () => {
bottomSheetRef.current?.expand();
});
return () => {
show.remove();
};
}, []);
The thing is that I can't reproduce this myself but Sentry has reported over 2.5k users experiencing this. What's weird to me about that 2.5k number is that the feature where the above code is, isn't much used. Could it be that the crash occurs when just applying the KeyboardProvider?
from react-native-keyboard-controller.
Yes, the issue will occur when you've wrapped app into KeyboardProvider
(underhood it'll render KeyboardControllerView
which setup all listeners and etc.).
@gunnartorfis could you please try to apply patch from #157 and see whether the amount of errors will be decreased?
from react-native-keyboard-controller.
Yes, the issue will occur when you've wrapped app into
KeyboardProvider
(underhood it'll renderKeyboardControllerView
which setup all listeners and etc.).@gunnartorfis could you please try to apply patch from #157 and see whether the amount of errors will be decreased?
I see, thanks. Since I'm unable to reproduce the issue myself I don't want to release the patch to production until it has been released. If you have any ideas on how I might reproduce this myself then I'd be happy to. It seems to be hitting quite the range of iOS versions, etc - I'm on 16.3 myself.
from react-native-keyboard-controller.
@gunnartorfis that's the problem that I don't know how to reproduce this crash 🤷♂️ I can not reproduce the problem in example app and I don't have reproducible example.
I have only guesses, that the reference to the keyboard view is changing and I'm trying to remove an observer which doesn't exist anymore... I really hope this patch can fix everything - if not, then I'll be happy to continue investigation on how to resolve the problem. The new version of the library 1.5.4
will be published today.
@gunnartorfis since you are not using other functionality apart of keyboardWillShow
you can safely downgrade keyboard-controller
version to 1.4.4
- this version will not have crashes, since I'm not using KVO mechanism in this version.
from react-native-keyboard-controller.
GitHub automatically closed this issue since PR that had a reference to this issue was merged.
I've published 1.5.4
to npm-registry. Hopefully the issue is resolved, but in any case feel free to re-open this issue or feel free to create a new one.
from react-native-keyboard-controller.
I'm seeing this issue in bugsnag with 1.10.3
Here's the stack trace:
Hardware Model: iPhone14,5
Process: App
Identifier: com.app
Role: Foreground
OS Version: iOS 16.5
NSRangeException: Cannot remove an observer <KeyboardMovementObserver 0x283160310> for the key path "center" from <UIInputSetHostView 0x10b613c70> because it is not registered as an observer.
0 CoreFoundation +0x9cb0 ___exceptionPreprocess
1 libobjc.A.dylib +0x183cc _objc_exception_throw
2 Foundation +0x6621c -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:]
3 Foundation +0x65f5c -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
4 Foundation +0x65e6c -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:]
5 App +0x571850 KeyboardMovementObserver.removeKVObserver() (KeyboardMovementObserver.swift:98:20)
6 App +0x572b50 @objc KeyboardMovementObserver.keyboardWillAppear(_:)
7 CoreFoundation +0x3758c ___CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
8 CoreFoundation +0xdb824 ____CFXRegistrationPost_block_invoke
9 CoreFoundation +0xbe8b4 __CFXRegistrationPost
10 CoreFoundation +0x4baf8 __CFXNotificationPost
11 Foundation +0x5cd34 -[NSNotificationCenter postNotificationName:object:userInfo:]
12 UIKitCore +0xb7ed9c -[UIInputWindowController postNotificationName:userInfo:]
13 UIKitCore +0x39245c ___68-[UIInputWindowController postValidatedStartNotifications:withInfo:]_block_invoke
14 UIKitCore +0x3b2e28 -[UIInputWindowController postValidatedStartNotifications:withInfo:]
15 UIKitCore +0x314424 -[UIInputWindowController postStartNotifications:withInfo:]
16 UIKitCore +0xb7fad4 ___77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke_4
17 UIKitCore +0x3d8ad0 +[UIView(UIViewAnimationWithBlocksPrivate) _modifyAnimationsWithPreferredFrameRateRange:updateReason:animations:]
18 UIKitCore +0xcd2ac +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:]
19 UIKitCore +0x5538c0 +[UIView(UIViewAnimationWithBlocks) _animateWithDuration:delay:options:animations:start:completion:]
20 UIKitCore +0x2ce2b4 -[UIInputViewAnimationStyle launchAnimation:afterStarted:completion:forHost:fromCurrentPosition:]
21 UIKitCore +0x2ce174 -[_UIViewControllerKeyboardAnimationStyle _launchAnimation:afterStarted:completion:forHost:fromCurrentPosition:]
22 UIKitCore +0x2cde80 +[UIView(Animation) _performWithAnimation:]
23 UIKitCore +0x2cddc8 -[_UIViewControllerKeyboardAnimationStyle launchAnimation:afterStarted:completion:forHost:fromCurrentPosition:]
24 UIKitCore +0xb807d0 ___77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke.459
25 UIKitCore +0x36f4e4 -[UIInputWindowController chainPlacementsIfNecessaryFrom:toPlacement:transition:completion:]
26 UIKitCore +0x36ca9c -[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]
27 UIKitCore +0x36bc00 -[UIInputWindowController setInputViewSet:]
28 UIKitCore +0x36b638 -[UIInputWindowController performOperations:withAnimationStyle:]
29 UIKitCore +0x27b92c -[UIKeyboardSceneDelegate setKeyWindowSceneInputViews:animationStyle:]
30 UIKitCore +0x27ae20 -[UIKeyboardSceneDelegate setInputViews:animationStyle:]
31 UIKitCore +0x204678 -[UIKeyboardSceneDelegate setInputViews:animated:]
32 UIKitCore +0x20168c -[UIKeyboardSceneDelegate setInputViews:]
33 UIKitCore +0x8ea2e4 ___102-[UIKeyboardSceneDelegate _reloadInputViewsForKeyWindowSceneResponder:force:fromBecomeFirstResponder:]_block_invoke.329
34 UIKitCore +0x8e9d74 -[UIKeyboardSceneDelegate _reloadInputViewsForKeyWindowSceneResponder:force:fromBecomeFirstResponder:]
35 UIKitCore +0x8e8a30 -[UIKeyboardSceneDelegate _reloadInputViewsForResponder:force:fromBecomeFirstResponder:]
36 UIKitCore +0x27c8c0 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews]
37 UIKitCore +0x21a44c -[UIResponder becomeFirstResponder]
38 UIKitCore +0xfdb73c ___99-[_UIRemoteViewController _serviceWantsKeyboardEventsWithPromotedFirstResponder:completionHandler:]_block_invoke
from react-native-keyboard-controller.
Related Issues (20)
- Expose style prop of chidren of KeyboardAwareScrollView HOT 2
- [IOS] Incorrect behavior of hooks and components when focusing on an input with secureTextEntry enabled. HOT 14
- [KASV] white space in the end of ScrollView on keyboard hide
- `useFocusedInputHandler` and `onChangeText` handler ignores an input from `react-native-text-input-mask` on iOS
- Incorrect KeyboardAvoidingView calculations on Android HOT 5
- Slow back scroll on `KeyboardAwareScollView` on some Android devices HOT 1
- Check for `ScrollView` ancestor in `KeyboardAwareScrollView`
- `onScroll` on `KeyboardAwareScrollView` is not fired
- KeyboardAwareScrollView not working on first load of the app after fresh install in production iOS builds HOT 1
- Bottom Sheet component compatibility/custom native wrapper(long-term feature) HOT 2
- KeyboardAwareScrollView scrolling too much when pasting a lot of content in multiline inputibox HOT 8
- KeyboardAwareScrollView has no ref prop HOT 3
- [ios] build error 'react_native_keyboard_controller-Swift.h' file not found HOT 8
- modal looks weird after use TextInput on KeyboardAwareScrollView HOT 13
- Animated keyboard values do not update if the focussed TextInput exists within a modal HOT 9
- Compilation Error on iOS with Fabric and `useFrameworks: 'static'` HOT 3
- Add an ability to show views over the keyboard (when it's open)
- KeyboardToolbar component with different text input types
- useKeyboardAnimation hook always returns 0 HOT 9
- KeyboardProvider changes windowSoftInputMode HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-keyboard-controller.