None of the press events work on ListItem.Swipeable
See original GitHub issueI tried to implement this in numerous ways. Nothing works. I have also tried to tye press events on items itself also 0 effects.
None of the onLongPress or onPress works anywhere, not on ListItem.CheckBox or on items in the list. As you can see I even tried with Pressable. 0 effect.
What am I doing wrong? I see nothing about Swipeable not being able to receive these events in the documentation.
Also while I’m at it, implementing scroll view with Swipeable is not working properly, I had to add padding on sides to be able to scroll list on edges. I searched for answers everywhere. How can I control swiping and scroll actions of ListItem.Swipeable?
{items.map((l, i) => (
<ListItem.Swipeable
key={l.id}
bottomDivider
rightContent={
<Button
title='VIŠE'
icon={{ name: 'menu-open', color: 'white' }}
buttonStyle={{
minHeight: '100%',
backgroundColor: GLOBAL.ALTCOLOR
}}
// onPress={() => toggleModal(l, 'modal1')}
/>
}
leftContent={
<Button
title='OBRIŠI'
icon={{ name: 'delete', color: 'white' }}
buttonStyle={{
minHeight: '100%',
backgroundColor: 'red'
}}
// onPress={() => addMore(l.value)}
/>
}
>
{/* <Icon
name='clipboard'
size={20}
iconStyle={{ margin: 0, padding: 0 }}
/> */}
{/* <Pressable onPress={() => HandleCheckBoxPress(l)}> */}
<ListItem.CheckBox
iconType='material'
checkedIcon='check-box'
uncheckedIcon='check-box-outline-blank'
checkedColor={GLOBAL.ALT2COLOR}
checked={l.checked}
// onIconPress={() => HandleCheckBoxPress(l)}
// onPress={() => HandleCheckBoxPress(l)}
onPress={() => console.log(true)}
center={true}
/>
{/* </Pressable> */}
<ListItem.Content>
<ListItem.Subtitle style={{ fontWeight: 'bold' }}>
<Badge
value={l.values.length}
status='success'
badgeStyle={{
marginTop: 0,
marginRight: 7,
padding: 0,
backgroundColor: GLOBAL.MAINCOLOR
}}
/>
{l.time}
</ListItem.Subtitle>
</ListItem.Content>
<ListItem.Chevron />
</ListItem.Swipeable>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13 (1 by maintainers)
Top Results From Across the Web
SwipeListener on ListView and ClickListener on ListView's items
I have implemented right to left swipe listener on my ListView. If I start the ListView swipe from an empty space in ListView,...
Read more >ListItem.Swipeable - React Native Elements
We offer a special kind of ListItem which is swipeable from both ends and allows users select an event.
Read more >React Native Swipeable List - Kurzor
React Native work with list item structure resized The drawing you see above is the core component of our application called the Item....
Read more >Gestures and Touch Events | CodePath Android Cliffnotes
Swipe Gesture Detection. Detecting finger swipes in a particular direction is best done using the built-in onFling event in the GestureDetector.
Read more >Lists - Material Design
To archive a list item, swipe it. Items can be dragged to reorder a list.
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 FreeTop 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
Top GitHub Comments
@arpitBhalla this change appears to be all good. The onPress and onLongPress events are now responding as they should both on Android and iOS devices. I’ve also verified that the existing behaviour (eg: scrolling, swiping with buttons, etc) continues to work as it should. Please commit this through to the stable build and final 4.0 release.
Your work on this is GREATLY appreciated!
@arpitBhalla really hoping you manage to fix this - I can see you have it tagged to 4.0. I will certainly be testing the 4.0 beta once it is fixed.