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

Overlay scroll disable #13

Open
mayurpatel6 opened this issue Oct 19, 2022 · 5 comments
Open

Overlay scroll disable #13

mayurpatel6 opened this issue Oct 19, 2022 · 5 comments

Comments

@mayurpatel6
Copy link

mayurpatel6 commented Oct 19, 2022

The overlay doesn't disable the scroll on other components of the screen. How should i do that?

@rikusen0335
Copy link
Collaborator

Sorry for inactivity, due to busy time I cannot investigate issue. Please wait or somehow investigate yourself.

@muile-dev
Copy link

Hi @rikusen0335 , For now. Once the reference needs to scroll down(now it automatically) to view the entire coach mark screen. Seem it does not work correctly by the position. Can you check this issue?

@rikusen0335
Copy link
Collaborator

rikusen0335 commented Nov 24, 2022

Sorry, I couldn't get what are you talking about, could you make an example gif that describe the issue or tell me more context.

@muile-dev
Copy link

@rikusen0335 sorry for missing that. I think we should have more of a prop like scrollElement to specify the element scrolled.

const scrollElement = props.scrollElement
		? document.querySelector(props.scrollElement)
		: window;

useEffect(() => {
	if (!(props.activate && props.element)) return;

	props.element?.scrollIntoView({ behavior: 'smooth', block: 'center' });
	dimensionSetter({ element: props.element, setDimension });
	const scrollEvent = () =>
		debounce(dimensionSetter, 300)({ element: props.element, setDimension });
	if (!scrollElement) return;

	scrollElement.addEventListener('scroll', scrollEvent);
	scrollElement.addEventListener('resize', scrollEvent);

	return () => {
		scrollElement.removeEventListener('scroll', scrollEvent);
		scrollElement.removeEventListener('resize', scrollEvent);
	};
}, [props.activate, props.element, scrollElement]);

@rikusen0335
Copy link
Collaborator

rikusen0335 commented Nov 24, 2022

What is current actual behavior?

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

3 participants