Skip to content

ERROR while scrolling back outside the refferred scrollview #148

Open
@nihatt

Description

@nihatt

in my code zone 1 and 2 works perfectly with scroll thanks to @xcarpentier
but when i come to zone 3 which is outside the scroll view i get an error which is telling me

`view <RCTShadowView: 0x7f8efd4bdb90; viewName: RCTView; reactTag: 105; frame: {{0, 0}, {234, 24}}> (tag #105) is not a descendant of <RCTShadowView: 0x7f8efd4725c0; viewName: RCTScrollView; reactTag: 669; frame: {{0, 108}, {390, 657}}> (tag #669)

RCTMeasureLayout
RCTUIManager.m:1392
-[RCTUIManager measureLayout:relativeTo:errorCallback:callback:]
invoking_
-[NSInvocation invoke]
-[NSInvocation invokeWithTarget:]
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread
`

my code is like that :

` <View style={{ width: '60%' }}>

<TouchableOpacity
style={[styles.profileImage]}
onPress={() => toggle()}>

{patientDetail?.data?.fullName ?? ''}






<TouchableOpacity
style={{
paddingTop: 10,
}}
onPress={() => {
navigation.navigate('BasketScreen');
}}>

              <IconBasket />
              {userBasketCount > 0 && (
                <LinearGradient
                  colors={['#253FC4', '#000D4F']}
                  style={{
                    position: 'absolute',
                    top: 0,
                    right: 0,
                    width: 22,
                    height: 22,
                    borderRadius: 11,
                    justifyContent: 'center',
                    alignItems: 'center',
                  }}>
                  <Text style={{ ...FONTS.f1, color: 'white' }}>
                    {userBasketCount}
                  </Text>
                </LinearGradient>
              )}
            </TouchableOpacity>
        <TouchableOpacity
          style={{
            paddingTop: 10,
          }}
          onPress={() => {
            navigation.navigate('NotificationScreen');
          }}>
          <IconNotification />
          {userNotificationCount > 0 && (
            <LinearGradient
              colors={['#253FC4', '#000D4F']}
              style={{
                position: 'absolute',
                top: 0,
                right: 0,
                width: 22,
                height: 22,
                borderRadius: 11,
                justifyContent: 'center',
                alignItems: 'center',
              }}>
              <Text style={{ ...FONTS.f1, color: 'white' }}>
                {userNotificationCount}
              </Text>
            </LinearGradient>
          )}
        </TouchableOpacity>

        <TouchableOpacity
          style={{
            paddingTop: 10,
          }}
          onPress={() => {
            handleScaleChange();
          }}>
          <IconMenu />
        </TouchableOpacity>
      </View>
    </View>
    <ScrollView
      ref={(r) => { scrollRef.current = r }}
      contentContainerStyle={{ flexGrow: 1 }}
      scrollEventThrottle={16}
      keyboardShouldPersistTaps={'always'}
      showsVerticalScrollIndicator={false}
      refreshControl={
        <RefreshControl
          refreshing={refreshing}
          onRefresh={loadDashboardDetail}
        />
      }
    >
      <View style={styles.container}>
        <View style={styles.section}>
          <TextInput
            style={styles.input}
            value={search}
            placeholder={strings.searchDasboardPlaceHolder}
            onChangeText={text => setSearch(text)}
            keyboardType="default"
            onSubmitEditing={() => {
              navigation.navigate('SearchHospitalSectionScreen', {
                searchText: search,
              });
              setSearch('');
            }}
          />
        </View>
        <View>
          <TourGuideZone
            zone={1}
            text={mainTourValues[0].appTutorialResource.title}
            borderRadius={16}
          >
            <SwiperFlatList
              autoplay
              autoplayDelay={3}
              autoplayLoop
              index={0}
              contentContainerStyle={{ marginHorizontal: 15 }}
              borderRadius={15}
              showPagination
              keyExtractor={(item, index) => index.toString()}
              data={dashboardData?.sliderList}
              paginationStyleItemActive={styles.paginationStyleItemActive}
              paginationStyleItemInactive={styles.paginationStyleItemInactive}
              paginationActiveColor={'#B1292F'}
              paginationDefaultColor={'#F4888C'}
              renderItem={({ item }) => (
                <Pressable
                  key={item.key}
                  style={styles.child}
                  onPress={async () => {
                    const result = await getSliderDetailById(item.id);
                    navigation.navigate('SliderDetailScreen', {
                      item: result?.data?.sliderResource,
                    });
                  }}>
                  <Image
                    style={styles.imageStyle}
                    resizeMode="contain"
                    source={{
                      uri: item?.sliderResource?.image,
                    }}
                  />
                </Pressable>
              )}
            />
          </TourGuideZone>
        </View>
        {/* Hizmet Paketleri */}
        {serviceData?.length !== 0 && (
          <>

            <View style={styles.serviceView}>
              <Text
                style={[
                  styles.textSizeLarge,
                  styles.textBlue,
                  styles.textBold,
                ]}>
                {strings.servicePackages}
              </Text>
              <Text
                onPress={() => navigation.navigate('PackageScreen')}
                style={[
                  styles.textSizeMedium,
                  styles.textUnderline,
                  styles.textBlue,
                ]}>
                {strings.seeAll}
              </Text>
            </View>
            <View style={styles.shadow}>

              <FlatList
                data={serviceData}
                renderItem={item => (
                  <RenderPackageList {...item} getDetail={getDetail} />
                )}
                contentContainerStyle={styles.flatlistContent}
                keyExtractor={(item, index) => index.toString()}
                horizontal={true}
                scrollEnabled
                showsHorizontalScrollIndicator={false}
              />

            </View>

          </>
        )}

        {/* Randevular */}
        <>
          <View ref={stepRef2} style={styles.serviceView}>

            <Text
              style={[
                styles.textSizeLarge,
                styles.textBlue,
                styles.textBold,
              ]}>
              {strings.upcomingAppointments}
            </Text>

            <TouchableOpacity
              onPress={() => navigation.navigate('AppointmentListScreen')}>

              <Text
                style={[
                  styles.textSizeMedium,
                  styles.textUnderline,
                  styles.textBlue,
                ]}>
                {strings.seeAll}
              </Text>

            </TouchableOpacity>
          </View>
          <View
            style={{
              height:
                dashboardData?.appointments?.futureList.length !== 0
                  ? 240
                  : 'auto',
            }}>
            <>
              {dashboardData?.appointments?.futureList.length === 0 ? (
                <View style={styles.flexDirectionRow}>
                  <TourGuideZone
                    zone={2}
                    text={mainTourValues[1].appTutorialResource.description}
                    borderRadius={16}
                  >
                    <TouchableOpacity
                      style={[
                        styles.appointmentFirstItem,
                        styles.alignSelf,
                        styles.alignItems,
                        styles.shadow,
                      ]}
                      onPress={() =>
                        navigation.navigate('AppointmentScreen')
                      }>

                      <IconMakeAppointment />
                      <Text style={styles.appointmentText}>
                        {strings.appointment}
                      </Text>

                    </TouchableOpacity>
                  </TourGuideZone>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions