Closed canberkakartuna closed 1 year ago
Swipe action triggers onClick event
Steps to reproduce the behavior:
Expected behavior: onClick should work apart from swipe actions
Desktop (please complete the following information):
Code:
const trailingActions = (onDelete) => ( <TrailingActions> <SwipeAction onClick={onDelete} destructive={true}> <ActionContent style={{ backgroundColor: 'red' }}> <DeleteOutlined style={{ fontSize: 18 }} /> </ActionContent> </SwipeAction> </TrailingActions> ); <SwipeableList fullSwipe={false} type={ListType.IOS}> {!!items.length && items?.map((item) => ( <SwipeableListItem leadingActions={null} trailingActions={trailingActions(() => removeItem(item))} key={item?.id} onClick={(e) => { console.log('click'); // THIS CODE SHOULD NOT WORK ON SWIPE BUT IT DOES. }} > <Card style={{ borderRadius: 0, width: '100%' }}> <Row> <Col span={1}>1</Col> <Col span={20}> <p>{item?.name}</p> </Col> <Col span={3}> <p>{item?.totalCost}</p> </Col> </Row> </Card> </SwipeableListItem> ))} </SwipeableList>
@all-contributors please add @canberkakartuna for bug
@marekrozmus
I've put up a pull request to add @canberkakartuna! :tada:
@canberkakartuna Fixed in 1.9.1 - thanks :)
Thanks @marekrozmus :)
Swipe action triggers onClick event
Steps to reproduce the behavior:
Expected behavior: onClick should work apart from swipe actions
Desktop (please complete the following information):
Code: