question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ANDROID] onPress Event for Tabs

See original GitHub issue

react-native, react and native-base version

native-base: “^2.3.1”, react: “16.0.0-alpha.12”, react-native : “0.47.1”,

Expected behaviour

How do call a function when Native base Tab Component is clicked / pressed.

Actual behaviour

onPress event not working in Tab component

Steps to reproduce (code snippet or screenshot)

<Container>
   <Tabs style={{}} tabBarPosition="bottom" >
          <Tab style={{}} heading='Network' onPress={() => console.log("tab1")}>
          </Tab>
          <Tab style={{}} heading='Jobs' onPress={() => console.log("tab2")}>
          </Tab>
    </Tabs>
</Container>

Screenshot of emulator/device

Is the bug present in both ios and android or in any one of them?

maybe a feature needed for ANDROID

Any other additional info which would help us debug the issue quicker.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
akhil-gacommented, Oct 26, 2017

@Naveen-ICARUS you can use onChangeTab prop of <Tabs/> which can be used to detect a change in tab selection

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android TabWidget detect click on current tab - Stack Overflow
"I am trying to find way to be able to fire an onclick event on a tab when this tab is the current...
Read more >
Input events overview - Android Developers
On Android, there's more than one way to intercept the events from a user's interaction with your application. When considering events ...
Read more >
TabLayout | Android Developers
TabLayout provides a horizontal layout to display tabs. Population of the tabs to ... boolean, onInterceptTouchEvent(MotionEvent event).
Read more >
Button | Android Developers
As a result, the system executes the code you write in onClick(View) ... android:contextClickable, Defines whether this view reacts to context click events....
Read more >
UI events - Android Developers
Consuming certain ViewModel events in the UI might result in other UI state updates. For example, when showing transient messages on the screen ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found