-
Notifications
You must be signed in to change notification settings - Fork 956
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
Popover ignores translucent StatusBar on Android #743
Comments
Hi 👋 Can the code below fix your issue? I guess this is not a bug but an individual use-case import React from 'react';
import { StatusBar } from 'react-native';
import { OverflowMenu } from 'react-native-ui-kitten';
const OverflowMenuShowcase = (props) => (
<OverflowMenu
{...props}
style={{marginTop: StatusBar.currentHeight}}
/>
); |
Thanks for the response. I did exactly this yesterday and yes it does fix the issue. TBH the last time I was trying to use the popups I just gave up because of this. Only yesterday I figure out that it's the bar that causes the problem so I submitted the bug. The functionality is broken OOB so I see it as a bug (I expected that popup is positioned relatively to its child element which is not true in this case), but it's your call here in this repo :) Just mind that other people using translucent StatusBar will also see all pop-ups as not-working properly. |
We can think about handling this out of the box, thanks for reporting 👍 |
@artyorsh you know if it's possible to fix this without setting StatusBar to translucent? setting it to translucent makes the splashscreen and statusbar behave weird.. No way to do something like style={{marginTop: StatusBar.currentHeight}} for the Select component? |
@jorgnyg I run it normally within Bare RN application, no special config is required. I have no idea how to deal with it other way in Expo apps, to be honest. |
This is a valid issue for any comp using popover (currently having issue with select and datepicker comp), their popover will shifted because of translucent status bar, please fix this |
Is there any fix for this planned? I'm having the same issue with using Autocomplete and a hidden StatusBar |
Have you tried this #743 (comment)? |
Yes, I applied this workaround to "Datepicker" component but it doesn't work! |
I should apply the fix to "Calendar" component inside the DatePicker component. Do you know how can I do this ? |
No, sorry :( |
While, you can use patch-package and use this: For Select component apply this patch: @ui-kitten+components+5.0.0.patch diff --git a/node_modules/@ui-kitten/components/ui/select/select.component.js b/node_modules/@ui-kitten/components/ui/select/select.component.js
index a5525e8..fc77dac 100644
--- a/node_modules/@ui-kitten/components/ui/select/select.component.js
+++ b/node_modules/@ui-kitten/components/ui/select/select.component.js
@@ -356,6 +356,10 @@ const styles = react_native_1.StyleSheet.create({
},
popover: {
overflow: 'hidden',
+ // fix select popover in Android if StatusBar is translucent
+ get marginTop(){
+ return react_native_1.StatusBar.currentHeight
+ }
},
list: {
flexGrow: 0,
|
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
Translucent status bar breaks Overflow menus position on Android. It's moved up by the width of the statusbar.
Expected behavior:
Menus are displayed right below the container, work the same on iOS and Android, regardless of statusbar configuration.
Steps to reproduce:
<StatusBar translucent={true}/>
Related code:
As above.
Other information:
OS, device, package version
The text was updated successfully, but these errors were encountered: