-
-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bottom sheet not appearing for users that have reduced motion turned on #1743
Conversation
When will this fix be released? Is there a projection? |
hi @fobos531, thanks for submitting this PR but i have some concerns about it
|
Hello @gorhom, thank you for the reply, below find my response:
|
FYI a simple workaround was posted in a related GitHub issue: @gorhom Thank you so much for your work on this very useful library! I hope a solution can be soon integrated in the library as virtually any app using react-native-bottom-sheet will have this problem (that is the bottom sheets are not showing if reduce motion is enabled). I imagine most developers are unaware that they need to implement a manual fix. |
Reduced motion is not activated only manually from accessibility settings. It is also automatically activated by iOS in low battery mode. So, there are more users facing with this issue than we guess. I had hundreds of user reports/complaints only in a couple weeks after I upgrade reanimated to v3.5. Most of the screenshots from users were pointing battery < 15%. And all complaints stop after setting ReduceMotion.Never for BottomSheet. |
I have managed to repo the issue, thanks
Although I agree with your reasoning here, i still believe we should respect the customer settings. I have kicked off an investigation and found multiple issues that i have already started (v5):
Maybe for v4: i'll just merge your CR but i'm still hesitant, but i'll let you know later today. |
@fobos531 decided to merge this PR and introduce a long term fix in a follow up PR in the future. thanks again :) |
Thank you for the careful consideration and merging of the PR, much appreciated! |
gorhom#1674) fix: bottom sheet not appearing for users that have reduced motion turned on (gorhom#1743)(by @fobos531)
gorhom#1674) fix: bottom sheet not appearing for users that have reduced motion turned on (gorhom#1743)(by @fobos531)
I'm still experiencing this issue on version 4.6.1 when using the BottomSheetModal component |
Same here. Issue still exists in 4.6.1 with |
@christophby @MikeWoots i was able to solve this in 4.6.1 (w/reanimated 3) by applying the i made a hook to make it easier on myself: import { useBottomSheetSpringConfigs } from '@gorhom/bottom-sheet';
import { ReduceMotion } from 'react-native-reanimated';
export function useBottomSheetIOSReduceMotionOverride() {
// NOTE: @rkstar -- this is REQUIRED for bottom-sheet to work in
// ios if the "reduce motion" setting is enabled on the device.
// this is turned on by default on ios devices > iphone 14 when
// the "low battery" warning happens.
const animationConfigs = useBottomSheetSpringConfigs({
reduceMotion: ReduceMotion.Never,
stiffness: 200,
overshootClamping: true,
});
return { animationConfigs };
} and then in my bottom sheet usages.... const iosReduceMotionOveride = useBottomSheetIOSReduceMotionOverride();
<BottomSheet
ref={ref}
snapPoints={['50%']}
// etc...
{...iosReduceMotionOverride}
/> |
if someone is still caught up and not knowing where this is fix this is fix at release 4.6.3 my test
Thanks again for this fix |
Not work in Android for 4.6.3, i am still facing |
Hello @gorhom
Motivation
Thank you for this great library! Here's a super simple PR that fixes #1560 and #1674. In recent versions of Android and in iOS, there's a "Reduce motion" feature which decreases the overall number of animations alongside the OS and slightly alters them as well. With Reanimated's default settings, this now means that some animations will fail to run, including the very critical one which this library uses to present the sheet. Thankfully, Reanimated exposes an ability to override this config via a
reduceMotion
option on the animation configs. This PR hardcodes theReduceMotion.Never
option to the animate function. I don't think it would ever be in the interest of the user to override this, otherwise the sheet could fail to be presented, so that's the reason why I hardcoded it. I also pointed this to thev5
branch sincev5
has reanimated 3.x and it seems this API is available only since 3.x, and master is still on2.x
. I've verified that this works on the example app and that sheets are presented with Reduce Motion turned on a physical iPhone 14 Pro running 17.3, whereas it was broken whenReduceMotion.Never
was NOT used.