Skip to content

locomotive scroll == no dialog windows? #519

Open
@piscopancer

Description

@piscopancer

When I attempt to change an element to be scrolled by the locomotive it just does not work. I could see a workaround on the v5 docs using event listeners for a wheel, but it's such a mess I could not imagine writing this in my own app.

I also tried below code in Lenis before, same thing. There is absolutely no reaction from these libraries whatsoever 😕.

export function LocomotiveScroll() {
	const { locomotive, locomotiveContainer } = useGlobalSnapshot()

	useEffect(() => {
		store.locomotive = ref(new Locomotive())
	}, [])

	useEffect(() => {
		locomotive && store.locomotive!.destroy()
		store.locomotive = ref(new Locomotive({ el: locomotiveContainer || undefined }))
	}, [locomotiveContainer])

	return <></>
}

My question is simple: how do you work with dynamic elements popping up, eg dialogs, modals? I have no idea why destroying and isntance and recreating it with an el set to the dialog scrollable container has no reaction 😕.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions