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

Can we have sticky headers inside the modal? #11

Closed
Ragularuban opened this issue Dec 23, 2018 · 8 comments
Closed

Can we have sticky headers inside the modal? #11

Ragularuban opened this issue Dec 23, 2018 · 8 comments
Labels
🚀 New feature New feature or request

Comments

@Ragularuban
Copy link
Contributor

Ragularuban commented Dec 23, 2018

Is there a possibility to add sticky headers to the content inside modal?

<Scrollview stickyHeader={[0,1]}>
... Content
</Scrollview>

PS:

  1. The absolute property of header and footer component is not clear
@jeremybarbet
Copy link
Owner

Are you thinking about something like this https://facebook.github.io/react-native/docs/sectionlist#stickysectionheadersenabled?

Maybe the absolute property for the header/footer is not specific enough. But in short, isAbsolute makes the header either on top of the scrollview or not.

Do you think about something better?

@jeremybarbet jeremybarbet added the ❔ Question Further information is requested label Dec 23, 2018
@Ragularuban
Copy link
Contributor Author

@jeremybarbet that implementation also works fine.
A simple implementation would be https://facebook.github.io/react-native/docs/scrollview#stickyheaderindices

@Ragularuban
Copy link
Contributor Author

Maybe the absolute property for the header/footer is not specific enough. But in short, isAbsolute makes the header either on top of the scrollview or not.

I figured it later on. I believe the documentation could state that we must add custom stylings to make it work.

@jeremybarbet
Copy link
Owner

I have to take a look for the stickyHeaderIndices, but I don't see a reason it wouldn't work.

Yes, you are right, this is confusing. I should say "if you use position absolute on your header component then you have to pass isAbsolute: true". I wanted and still, want to do it automatically, but I haven't found a way to check the header style object to see if the position property is passed or not. Any ideas are welcome!

@Ragularuban
Copy link
Contributor Author

I guess you could use

let style =  element.props.style;
style = StyleSheet.flatten(style);
if(style.position == 'absolute'){
 ...
}

I have not tested this though.

@jeremybarbet
Copy link
Owner

Yes this is what I wanted to do, but I couldn't make it work. I'll try to find a way to remove this isAbsolute props, very not ideal

@jeremybarbet jeremybarbet added 🚀 New feature New feature or request and removed ❔ Question Further information is requested labels Jan 6, 2019
@jeremybarbet jeremybarbet added this to the 1.0.0 milestone Jan 7, 2019
@jeremybarbet
Copy link
Owner

@Ragularuban Alright, I don't know what I tried last time, but the element.props.style works fine, the isAbsolute props will be remove in the next release 👍

@jeremybarbet jeremybarbet removed this from the 1.0.0 milestone Jan 7, 2019
@jeremybarbet
Copy link
Owner

jeremybarbet commented Jan 14, 2019

You can now pass a scrollview/flatlist/sectionlist https://jeremybarbet.github.io/react-native-modalize/#/PROPSMETHODS?id=sectionlistprops

It will be available in next release

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

No branches or pull requests

2 participants