Skip to content

None of the press events work on ListItem.Swipeable #3218

@ikiK-CRO

Description

@ikiK-CRO

I 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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Closed or Merged 🏁

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions