Skip to content

Commit

Permalink
Fix gesture button states on web (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Jan 14, 2020
1 parent 28ae894 commit 8e189f2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Example/pagerAndDrawer/index.android.js
@@ -1,6 +1,6 @@
import ViewPagerAndroid from '@react-native-community/viewpager';
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import { StyleSheet, Text, View } from 'react-native';
import {
createNativeWrapper,
DrawerLayoutAndroid,
Expand Down Expand Up @@ -54,7 +54,7 @@ export default class Example extends Component {
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: Platform.OS === 'ios' ? 20 : 0,
paddingTop: 0,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
Expand Down
2 changes: 1 addition & 1 deletion touchables/GenericTouchable.js
Expand Up @@ -197,7 +197,7 @@ export default class GenericTouchable extends Component {
// This platform check is an implication of slightly different behavior of handlers on different platform.
// And Android "Active" state is achieving on first move of a finger, not on press in.
// On iOS event on "Began" is not delivered.
state === (Platform.OS === 'ios' ? State.ACTIVE : State.BEGAN) &&
state === (Platform.OS !== 'android' ? State.ACTIVE : State.BEGAN) &&
this.STATE === TOUCHABLE_STATE.UNDETERMINED
) {
// Moving inside requires
Expand Down
3 changes: 1 addition & 2 deletions touchables/TouchableNativeFeedback.android.js
Expand Up @@ -19,8 +19,7 @@ export default class TouchableNativeFeedback extends Component {
borderless,
});

static canUseNativeForeground = () =>
Platform.OS === 'android' && Platform.Version >= 23;
static canUseNativeForeground = () => Platform.Version >= 23;

static defaultProps = {
...GenericTouchable.defaultProps,
Expand Down
2 changes: 0 additions & 2 deletions touchables/TouchableOpacity.web.js

This file was deleted.

0 comments on commit 8e189f2

Please sign in to comment.