Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section Index Title Scrolling #134

Merged
merged 4 commits into from
Jul 20, 2017
Merged

Section Index Title Scrolling #134

merged 4 commits into from
Jul 20, 2017

Conversation

gensc004
Copy link
Contributor

@gensc004 gensc004 commented Apr 19, 2017

Fixes #125

  • Added ability to render native Section Index Title scrolling functionality. This exposes a new boolean prop called sectionIndexTitlesEnabled

  • Fixed bug I noticed with the allowsMultipleSelection feature where, when set to false, you could only select one element in a section as intended, but selecting an option under a different section would not deselect the original.

  • Fixed a bug in RNTableView/RNAppGlobals.h that would cause the build to fail when running on a mac with a case-sensitive file system.

@dkretsch12
Copy link

👍

@aksonov aksonov merged commit b0fd2fe into aksonov:master Jul 20, 2017
@MeKarina
Copy link
Contributor

MeKarina commented Aug 12, 2017

@gensc004 how to use this feature?

section index is not showing for this

<TableView style={{flex:1}} sectionIndexTitlesEnabled>
	<Section label="A">
		<Item image={require('../assets/trx30.png')} children='A' />
	</Section>
	<Section label="B">
		<Item image={require('../assets/tix30.png')} children='BB' />
		<Item image={require('../assets/psgr30.png')} children='bbb' />
		<Item image={require('../assets/trx30.png')} children='bbbb' />
		<Item image={require('../assets/trx30.png')} children='bbbbb' />
	</Section>
	<Section label="C">
		<Item image={require('../assets/tix30.png')} children='c' />
		<Item image={require('../assets/psgr30.png')} children='cc' />
		<Item image={require('../assets/trx30.png')} children='ccc' />
		<Item image={require('../assets/trx30.png')} children='cccc' />
	</Section>
	<Section label="D">
		<Item image={require('../assets/tix30.png')} children='d' />
		<Item image={require('../assets/psgr30.png')} children='dd' />
		<Item image={require('../assets/trx30.png')} children='ddd' />
		<Item image={require('../assets/trx30.png')} children='dddd' />
	</Section>
</TableView>

@gensc004
Copy link
Contributor Author

@MeKarina, just to clarify your example is sectionIndexTitlesEnabled set to true?

@MeKarina
Copy link
Contributor

MeKarina commented Aug 17, 2017

@gensc004 yes, just let it blank will set it to true..

do you have an example for this..??

@gensc004
Copy link
Contributor Author

gensc004 commented Aug 17, 2017

@MeKarina, After putting together an example I realized that there is a bug with this feature that is ignoring the sectionIndexTitlesEnabled bool and always adding the section titles. That doesn't explain why they aren't showing for you though...

This example is working in my environment, but it doesn't look like that will help you much.

<TableView
      style={{ flex: 1 }}
      sectionIndexTitlesEnabled
>
      <Section label="A">
             <Item key="a" label="a section" />
      </Section>
</TableView>

What version of RN are you on? And could you post a screenshot of what you do see? I wonder if maybe the images rendering in the items could be big enough eclipse the section titles? Sorry if I am not being very helpful.

@gensc004
Copy link
Contributor Author

This PR is slightly broken. Opened #142 to fix it. @MeKarina I don't think that the fix will impact what you are experiencing, so i will keep trying to help.

@MeKarina
Copy link
Contributor

@gensc004 really sorry... i just noticed that latest version of this library hasn't included this PR... so i install this pr and it's working now...

sorry n thank Youu so much.. =)

@gensc004
Copy link
Contributor Author

@MeKarina I am glad it works for you know! If #142 gets merged it will work even better. Wahoo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants