-
Notifications
You must be signed in to change notification settings - Fork 76
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
not referring the elements when scrolling time. it is stick at the browser #133
Comments
I am facing the same issue. @RajasekharReddy82 did you already find a way to resolve this? I took a screenrecording with the example from the ReadMe. In Mozilla Firefox and Chrome it looks like this: |
@RajasekharReddy82 I could fix my problem, I will share in case it is relevant for you too. I tried before with something like this: import Xarrow, {useXarrow, Xwrapper} from 'react-xarrows';
const SomeComponent = () => {
const updateXArrow = useXarrow();
useEffect(() => {
window.addEventListener("scroll", updateXArrow)
return () => window.removeEventListener("scroll", updateXArrow)
})
return (<div className="container">
<Xwrapper>
<Draggable onDrag={updateXArrow}><div id="elem1">element 5</div></Draggable>
<Draggable onDrag={updateXArrow}><div id="elem2">element 6</div></Draggable>
<Xarrow start="elem1" end="elem2"/>
</Xwrapper>
</div>)
}; The problem for me was that
|
If you set |
Im having the weird issue that window resize listener in useEffect is not updating using updateXarrow() its the only listener that does nothing |
Describe the bug & Expected behavior
A clear and concise description of what the bug is.
passed id to xarrows its is working good but when i am trying to scroll it is not scrolling for that element it fixed at same position and i am using positons relative and absolute in my components not using any fixed positions.
To Reproduce
Steps to reproduce the bug: what props where used, in what way the lib was used?
provide preferably minimal code snippets/codesandbox/gitpod.
Screenshots

If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: