Bug: Vertical Offset on Android
See original GitHub issueCurrent Behavior
Tutorial tooltips work on iOS, but on Android they have a - Y offset
, which is not the desired behavior.
Input Code
I created a blank RN project with: react-native init CopilotTest
, and added these lines to App.js
:
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
+import { copilot, walkthroughable, CopilotStep } from '@okgrow/react-native-copilot'
+const CopilotView = walkthroughable(View)
+const CopilotText = walkthroughable(Text)
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
android:
'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
type Props = {};
class App extends Component<Props> {
+ componentDidMount() {
+ this.props.start()
+ }
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
+ <CopilotStep text='Test Copilot Step' order={1} name='test'>
+ <CopilotText>Test</CopilotText>
+ </CopilotStep>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
-export default App
+export default copilot()(App)
Expected behavior/code Android should work the same way it does on iOS
Environment
-
Device iOS: iPhone 5 [iOS 10], Simulators: iPhone 6, 7 [iOS 12]
-
Device : Xiaomi Mi A2, Android Studio Emulators [Oreo, Marshmallow]
-
react-native-copilot
: GitHub dependency, SHA-1: 13ecbca5c9dc1597bd3a7d83d778ecd1a568eb66 -
react-native
: v0.56, v0.57 -
react-native-svg
: 8.0.10
Possible Solution I will look into it…
Additional context/Screenshots
iOS (working properly):
Android (NOT working properly):
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
mohebifar/react-native-copilot - Vertical Offset on Android
Tutorial tooltips work on iOS, but on Android they have a - Y offset , which is not the desired behavior. Input Code....
Read more >Android spinner vertical offset changed - Stack Overflow
Try the View.Invisible instead of View.Gone because its taking its space after. This will help you to fix the overlaying problem ;). –...
Read more >Offset - Android Developers
For example, the top-left position of children in the RenderBox protocol is typically represented as an Offset from the top left of the...
Read more >Firefox/Android and paired mouse - vertical offset bug - YouTube
Bug in Firefox/Android with a paired/external mouse - when moving mouse, hit testing (to fire mouseover/mouseenter/mouseleave/mouseout) has a vertical ...
Read more >[Bugs] - CollectionView,When I use ScrollTo, VerticalOffset ...
Bug 1. When I use mycollectionview.ScrollTo (0) or mycollectionview.ScrollTo (0, animate: true), VerticalOffset increments its value · Bug 2
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You should do
copilot({androidStatusBarVisible: true})
.This solution worked for me, tested on iOS and Android: