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
Container inside react component #138
Comments
Is your DOM node a scrolling div? |
Yes I have the overflow as scroll. I am not getting any errors so it is finding the container. The scroll logic just doesn't work. |
Ok, I got it to work with overflow:auto, and container height 100vh. The problem now is there are 2 scrollbars. I am trying to achieve something like this. https://ueno.co/careers#new-york-city |
I really like that idea! Do you have a demo page I can look at? |
That's a bit of a small demo. Anything with your code in there already? Do you have content before or after the panels like the inspiration page you shared? |
https://yjo5y0mvlx.codesandbox.io/ If I set the container to document.body the snap functionality only works until all sections leave the screen. It then says no snapable sections found. If I set the container to a specific div and make it scrollable then there are 2 scrollbars that cause problems as you can see in the demo. |
So is in not possible to have non snap-able section when the container is the body? Could really use your help... |
All good, just had to rework your code. thx |
Just wondering: what did you change? Changing the internals of a library is usually not a great idea. But is this something that should be in the library by default? |
Ah, I see your case: you want to be able to scroll freely when there are no containers in the viewport. Would adding an option to tell the plugin wether to |
I am having a hard time with the container option. Could you please assist in helping me create a container? Not all my section will need to have a snap option.
componentDidMount() {
const node = ReactDOM.findDOMNode(this);
this.panelSnapInstance = new PanelSnap({
container: node,
panelSelector: '.panel'
});
}
The text was updated successfully, but these errors were encountered: