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.

ListItem Button Press isn't showing any feedback on Android

See original GitHub issue

I have gone through these following points

Issue Description

node, npm, react-native, react and native-base version, expo version if used, xcode version

Node: 13.3.0 Yarn: 1.21.1 React Native: 0.61.2 React: 16.9.0 XCode: 11.2.1

Expected behaviour

Receive some type of feedback when List Item is pressed

Actual behaviour

There is 0 feedback. Tried adding in a Ripple effect with background={TouchableNativeFeedback.Ripple('blue', true)} and I can see the Ripple outside of the List Container but not directly from the List Item

Steps to reproduce

import React from 'react';
import {
  View,
  Icon,
  List,
  ListItem,
  Left,
  Right,
  Body,
  Text,
  Content,
  Container,
} from 'native-base';
import { TouchableOpacity } from 'react-native';
import { SwipeListView } from 'react-native-swipe-list-view';

const EntryListItem = () => (
  <ListItem
    button
    onPress={() => console.log('Native Base is the best!')}
    style={{ backgroundColor: 'white' }}
    noIndent>
    <Body>
      <Text>Here's some text</Text>
    </Body>
    <Right style={styles.listRightStyle}>
      <Icon
        style={styles.listIconStyle}
        active
        type="MaterialIcons"
        name="edit"
      />
    </Right>
  </ListItem>
);

const SwipeAwayListItem = () => {
  <TouchableOpacity
    onPress={() => console.log('You tried to delete, but it was me, Dio!')}
    style={{
      alignItems: 'center',
      backgroundColor: 'red',
      flex: 1,
      flexDirection: 'row',
      justifyContent: 'flex-end',
      paddingRight: 15,
    }}>
    <Text>Delete</Text>
  </TouchableOpacity>;
};

const ListContainer = ({}) => (
  <Container styles={{ flex: 1 }}>
    <Content>
      <React.Fragment>
        {/* <View>Container 1</View> */}
        {/* <View>Container 2</View> */}

        <List>
          <SwipeListView
            data={data}
            renderItem={({ item }) => <EntryListItem />}
            renderHiddenItem={() => <SwipeListView />}
            rightOpenValue={-75}
            disableRightSwipe
          />
        </List>
      </React.Fragment>
    </Content>
  </Container>
);


Is the bug present in both iOS and Android or in any one of them?

Just Android

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

I’ve tried:

  • changing the underlayColor to ‘black’.
  • Tried wrapping the entire ListItem in a TouchableOpacity which worked, but doesn’t play nicely with the inner components such as Body, Right.
  • Tried removing all of the wrappers such as the SwipeListView container, and just mapping out the ListItems => data.map(item => <EntryListItem />)
  • Removed other components like <Content> and the other components which you see in the code as Container ` & 2

###Important

If you want your issue to be looked at quicker, attach a snack reproducible with your issue. Makes it easier for us!

S N A C C : https://snack.expo.io/HyUs_mS0r

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kejlerjcommented, Dec 6, 2020

It works well for me, you have to add button AND an onPress function in your ListItem.

But I think it not very intuitive and it should show a feedback just with button.

1reaction
moedevelopercommented, Nov 28, 2020

the problem still persist i think its not working and i have the latest

Read more comments on GitHub >

github_iconTop Results From Across the Web

Click is not working on the Listitem Listview android
The first thing what you have to note here is, whenever there are Clickable elements like Buttons or ImageButtons present in your ListView...
Read more >
View - Android Developers
Even though a view can define a padding, it does not provide any support for ... a view should have haptic feedback enabled...
Read more >
Share a list or list item - Microsoft Support
Notes: In a SharePoint site, lists and lists items are usually available to everyone with permissions to the site. But in some cases,...
Read more >
User Interface - App Inventor
The Shape will not be visible if an Image is used. ShowFeedback: Specifies if a visual feedback should be shown when a Button...
Read more >
Keyboard shortcuts for Google Docs - Android
Note: Some shortcuts might not work for all languages or keyboards. ... Select current list item, hold Ctrl + Alt + Shift, press...
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