leecade / leecade/react-native-swiper

In the case of iPhone, touch is not available when using Flatlist items.

Open
#1,360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Which OS ?
MacOS 12.4

Version
react-native-swiper v1.6.0
react-native v0.64.4
Actual behaviour
In the case of iPhone, touch is not available when using Flatlist items.

How to reproduce it>
here is the code:

p.s. Whenever the is placed, it will still happen

                <FlatList
                    ref={ref => {
                        this._flHomeContent = ref;
                    }}
                    style={{flex: 1}}
                    showsVerticalScrollIndicator={false}
                    data={this.state.arr_list}
                    numColumns={1}
                    onViewableItemsChanged={this.onViewableItemsChanged}
                    viewabilityConfig={{
                        waitForInteraction: false,
                        itemVisiblePercentThreshold: 150
                    }}
                    renderItem={({ item, index }) => {
                        return (
                            <HomeFeedItem
			... ... ...
			/>

export default class HomeFeedItem extends React.Component {

...	...

render() {
        <TouchableWithoutFeedback onPress={() => {
            if(onDetail)
                onDetail();
        }}>
            <VerticalLayout style={{width: '100%'}}>
		...	...

                <View style={styles.swiper_content}>
                    <Swiper
                        showButtons={false}
                        horizontal={true}
                        autoplay={false}
                        style={{height: '100%'}}
                        showsPagination={false}
                        loop={false}
                        onIndexChanged={(index) => {
                            this.setState({swiper_active_index: index});
                        }}
                    >

                        {
                            item.arr_detail_img.map((it, idx) => {
                                return (
                                    <TouchableWithoutFeedback onPress={() => {
                                        if(it.type == 0 && onImgZoomView) {
                                            onImgZoomView(it.thumb_img_url);
                                        }
                                    }}>

		...	...	..





}

onPress() of not working

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided FlatList, HomeFeedItem, TouchableWithoutFeedback, and Swiper nesting on an iPhone with the reported React Native and react-native-swiper versions. Inspect how touch handling behaves between the nested components and verify that both TouchableWithoutFeedback onPress handlers can fire. Done means the reported item and image presses work reliably in the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.