Skip to content

Press Events Not Working on Screens with Interactive Components #276

@kenmoh

Description

@kenmoh

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

I am experiencing an issue where press events do not trigger on screens that contain interactive components such as Button, TextInput, when using react-native-bottom-tabs. The issue occurs consistently across different screens within the tab navigator.

Library version

0.8.3

Environment info

System:
  OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
  CPU: (4) x64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
  Memory: 1.37 GB / 5.69 GB
  Shell:
    version: 5.8.1
    path: /bin/zsh
Binaries:
  Node:
    version: 20.10.0
    path: ~/.nvm/versions/node/v20.10.0/bin/node
  Yarn:
    version: 1.22.22
    path: /snap/bin/yarn
  npm:
    version: 10.9.0
    path: ~/.nvm/versions/node/v20.10.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: latest
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.77.0 is now available (your project is running on v0.76.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.77.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.6&to=0.77.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=linux".

Steps to reproduce

Steps to Reproduce

1. Clone the Repository:
git clone https://github.com/kenmoh/rnbt-demo
cd rnbtdemo
2. Install Dependencies:
npm install
3. start:
npx expo start
4. Navigate to the Application:
  • Open the app on your device or emulator.
  • Click on the Profile tab
5. Attempt to Interact:
  • Try pressing the interactive components(TextInputs, Button). Observe that the press events do not trigger as expected.
Expected Behavior

Press events should work correctly on all screens, allowing users to interact with buttons and other interactive components.

Actual Behavior

Press events do not work on screens with interactive components. The components do not respond to touch events.

  • Platform: Android

Reproducible sample code

import { StyleSheet, View, TextInput, Button } from 'react-native';

export default function TabTwoScreen() {

  return (
    <View style={[styles.container]}>
      <TextInput keyboardType='email-address' placeholder='Email' style={[styles.inputContainer]} />
      <TextInput placeholder='Username' style={[styles.inputContainer]} />
      <TextInput secureTextEntry placeholder='Password' style={[styles.inputContainer]} />
      <View style={{ width: '90%', alignSelf: 'center' }}>
        <Button title='Submit' color={'black'} onPress={() => console.log('Sumitted')} />
      </View>

    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    gap: 10,
    marginTop: 100,

  },
  inputContainer: {
    width: '90%',
    alignSelf: 'center',
    borderWidth: StyleSheet.hairlineWidth,
    borderColor: 'skyblue',
    borderCurve: 'continuous',
    borderRadius: 10,
    paddingVertical: 15,
    paddingHorizontal: 10,
    backgroundColor: '#fff',
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions