bardog/Alpha-scroll-flat-list

Alpha Scrolling not working

Opened this issue · 12 comments

When data binded to AlphaScrollFlatList, and when scroll through alpha letters it always go to previous letter data instead of scrolled letter's data

fix:
this.list.scrollToOffset({ animated: false, offset: index * this.props.itemHeight * 1.2 });
to make it scroll further than usual

@jordangrant where do i add this ?

@ameenmattar did you find it? Don’t have access right now

@ameenmattar it is in node_modules > alpha-scroll-flat-list > src > index.js, in the function handleOnScroll

i have same issue..alphabets are not scrolling. still i replace the code in nodemodules -> src -> index.js in the function handleonscroll.
let me know if anything i have to change for alphabets scrolling...
anyone help me out from this..

@jordangrant where do i add this ?

Hey hi did yo uresolved this issue??

@naveenraj1592 I had to modify the following to make it work:

in AlphabeticScrollBar.js I had to change the variable top to align with the top of where my alpha list is on my screen (in my case 80% from the top + 70px)

getTouchedLetter (y) {
        const top = Math.abs(y) - (this.containerHeight * 0.8 - 70);

        if (top >= 1 && top <= this.containerHeight) {
            this.setState({
                activeLetterViewTop: top
            });

            return this.state.alphabet[Math.round((top / this.containerHeight) * this.state.alphabet.length)]
        }
    }

Then, to make my flatlist move the correct distance I modified in index.js:

this.list.scrollToOffset({ animated: false, offset: index * this.props.itemHeight * 1.2 });

Hope that helps.

hi @jordangrant i did the changes which you mentioned above but that alphabets are not scrolling its changes the size of alphabets thats it.so its not scrolling the alphabets

getTouchedLetter is not working when i change the code which you mentioned above not able to click kindly help to resolve this issue thanks in advance

processed

Hi i have attached screenshot of the issue am facing now so kindly check this ..i scrolled list its scrolling upto the end but alphabets are not scrolling .let me know if any one know any solution for this.

thanks in advance

anyone resolved this issue..or anyone suggest some alphabet list scrollview framework .thanks in advance

I made my custom alpha scroll list based on my requirements, but you can use this-
https://github.com/i6mi6/react-native-alphabetlistview or
https://github.com/cq0702/react-native-sectionlist-contacts

I have a similar issue where the list are not scrolling. I was using sample data list. First ensure that the scrollkey label ie: 'name' starts with UPPERCASE letter. I found that lowercase name doesnt trigger the scrolling.