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

update scroll #5

Open
iscorporacion opened this issue Jun 27, 2023 · 3 comments
Open

update scroll #5

iscorporacion opened this issue Jun 27, 2023 · 3 comments

Comments

@iscorporacion
Copy link

Is there a way to update scroll after modifying the content dynamically?

@ehsan-shv
Copy link
Owner

What do you want to update? Could you please make it clear?

@iscorporacion
Copy link
Author

i have two components, sidebar and mainContainer, both have ScrollContainer, when sidebar is opened, change size of the mainContainer, this causes the loss of scrolls in mainContainer, i do not know if by hiding sidebar unmount the scrollbars of mainContainer

<body>
<sidebar>
</sidebar>
<mainContainer>
</mainContainer>
</body>
'use client'
import React from "react";
import { ScrollContainer} from "react-nice-scroll";
import "react-nice-scroll/dist/styles.css";


const ScrollBarsContainer = ({
    children,
}: {
    children: React.ReactNode,
}) => {
    return (
        <ScrollContainer>
            {children}
        </ScrollContainer>
    )
}

export default ScrollBarsContainer

@ehsan-shv
Copy link
Owner

If you provide an online demo I could help better. There are several reasons that cause this issue.

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

No branches or pull requests

2 participants