react-native-raw-bottom-sheet icon indicating copy to clipboard operation
react-native-raw-bottom-sheet copied to clipboard

Press Events still not work

Open alitele opened this issue 4 years ago • 6 comments

Hi,

I am trying to add a touchable opacity inside RBSheet and strangely not press event working.

I have read the other thread regarding the TouchableOpacity import so my import is from 'react-native' Please suggest fix for it.

Thanks, Ali

alitele avatar Nov 23 '20 20:11 alitele

I have the same problem.

SamuelSSan28 avatar Dec 15 '20 09:12 SamuelSSan28

Also actual for me

RafaelA977 avatar Jan 31 '21 20:01 RafaelA977

Same problem, still no solution?

hoangvu12 avatar Apr 29 '21 02:04 hoangvu12

It's working for me now, I don't remember what i done . But I guess I put all content of the RBSheet inside a view worked for me.

SamuelSSan28 avatar Apr 29 '21 13:04 SamuelSSan28

I've been noticing that if I use TouchableOpacity directly in the RBSheet it works fine but if I try to render a sub component is when it stops working. Not sure if this is the same issue?

cah-christopher-scherer avatar Jun 03 '21 13:06 cah-christopher-scherer

TouchableOpacity worked for me.

 <RBSheet
      ref={bottomSheetRef}
      height={BOTTOM_SHEET_HEIGHT}
      customStyles={{
        container: {
          backgroundColor: 'transparent',
        },
      }}
      openDuration={250}>
      <BottomSheetContainer>
        <SheetHeader>{title}</SheetHeader>
        <PickerContainer>
          <DatePicker
            fadeToColor={theme.colorsGallery.grayColors.dark1}
            textColor={theme.colorsGallery.solidColors.orange}
            is24hourSource="locale"
            locale={'pt_BR'}
            androidVariant="iosClone"
            date={date}
            mode={mode}
            onDateChange={setDate}
          />
        </PickerContainer>
        <ButtonContainer>
          <TouchableOpacity onPress={handleCancel}>
            <RoundedButton
              useLargeText
              title="Fechar"
              colorTintTheme="default"
              filled
            />
          </TouchableOpacity>
          <TouchableOpacity onPress={save}>
            <RoundedButton
              useLargeText
              title="Salvar"
              colorTintTheme="primaryGradientColor"
              filled
            />
          </TouchableOpacity>
        </ButtonContainer>
      </BottomSheetContainer>
    </RBSheet>

Yes, this RoundedButton is already a TouchableOpacity but I don't know why it wasn't working so I put the RoundedButton as children of a TouchableOpacity and now it's working.

alvesmarcos avatar Oct 22 '21 20:10 alvesmarcos

If it persists in newer versions of react-native, please open a new issue.

nysamnang avatar Mar 07 '24 06:03 nysamnang