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

Next container is not properly inserted in the DOM #648

Closed
bossybe opened this issue Sep 9, 2021 · 5 comments · Fixed by #707
Closed

Next container is not properly inserted in the DOM #648

bossybe opened this issue Sep 9, 2021 · 5 comments · Fixed by #707
Assignees
Labels
@barba/css @barba/core plugin bug bug to fix
Milestone

Comments

@bossybe
Copy link

bossybe commented Sep 9, 2021

Hello all,

I would like to make Barba CSS work with Locomotive-scroll.
I do a simple opacity transition and a smooth scroll. Both work perfectly separately but together it doesn't work anymore.

My code :

const scroll = new LocomotiveScroll({
    el: document.querySelector('[data-scroll-container]'),
    smooth: true
});

barba.hooks.after(() => {
  scroll.init();
});

barba.use(barbaCss);
barba.use(barbaPrefetch);
barba.init()

While examining the dom, I noticed that at the change of page my <div data-barba = "container"> go out of my <main data-scroll-container>

Why does it do that? This problem happens when I use the @barba/css plugin, without it everything works.

Thank you in advance for your help

@xavierfoucrier xavierfoucrier added the question questioning about a functionality or usage label Sep 9, 2021
@xavierfoucrier
Copy link
Member

Hi @bossybe,

I will need some time to check and see what's going on.
Thanks for your patience! 😉

@dmitriyakkerman
Copy link

dmitriyakkerman commented Oct 17, 2021

Hi guys! Any updates here? I have the same behavior.

@xavierfoucrier
Copy link
Member

Hi @dmitriyakkerman,

Sorry I am busy right now, working to release a project at end of month.
I will have time for a complete check next month, stay tuned! 😉

@xavierfoucrier xavierfoucrier self-assigned this Feb 1, 2022
@PubliAlex
Copy link

Hello,

I confirm an issue with barba CSS, it move the whold data-barba="container" div to the very end of the page (just before the end of the body) When I remove the barbaCSS script and use JS transition instead, it works as expected.

@xavierfoucrier xavierfoucrier added the @barba/css @barba/core plugin label Nov 22, 2022
@xavierfoucrier xavierfoucrier added this to the barba@next milestone May 6, 2023
@xavierfoucrier xavierfoucrier added bug bug to fix @barba/core @barba/core plugin and removed question questioning about a functionality or usage @barba/core @barba/core plugin labels May 8, 2023
@xavierfoucrier
Copy link
Member

Hello 👋
Sorry for the long delay.

It's not related to Locomotive Scroll, but more similar to the issue #479. I already fixed it last week, but it looks in some situation it can be improved, especially when dealing with a more complex DOM structure.

@xavierfoucrier xavierfoucrier changed the title I can't get Barba CSS to work with Locomotive-Scroll Next container is not properly inserted in the DOM May 8, 2023
@xavierfoucrier xavierfoucrier linked a pull request May 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@barba/css @barba/core plugin bug bug to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants