ListItem Button Press isn't showing any feedback on Android
See original GitHub issueI have gone through these following points
- Check latest documentation: https://docs.nativebase.io/`
- Check for existing open/closed issues for a possible duplicate before creating a new issue: https://github.com/GeekyAnts/NativeBase/issues
- Use the latest NativeBase release: https://github.com/GeekyAnts/NativeBase/releases
- Check examples from NativeBase KitchenSink https://github.com/GeekyAnts/NativeBase-KitchenSink
- [] For discussion purpose make use of NativeBase Slack: http://slack.nativebase.io/
- [] For queries related to theme, check Theme Variables from Docs and live NativeBase Theme Editor http://nativebase.io/customizer/
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 aTouchableOpacity
which worked, but doesn’t play nicely with the inner components such asBody
,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:
- Created 4 years ago
- Comments:12 (2 by maintainers)
Top 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 >
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 Free
Top 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
It works well for me, you have to add
button
AND anonPress
function in yourListItem
.But I think it not very intuitive and it should show a feedback just with
button
.the problem still persist i think its not working and i have the latest