Closed aditygrg2 closed 1 year ago
Hello @glaslos, please check this PR, and let me know if I understood the requirement correctly
Understood. I will update this PR accordingly
Hi @glaslos,
I have tried these things while solving this problem -
I tried to control the scroll events through javascript, by analyzing that if the user is at the bottom (scrolled max), then I am updating the scroll values by maximum (scrollHeight - clientHeight), else the scroll value does not change and thus position remains intact. But this didn't work, as Svelte is updating changes but it is not considering and saving the scrolls, it is showing the element into view always.
In other frameworks like react, we can pass keys so that the re-rendering effect does not change or modify other properties of DOM, but I think in svelte passing keys is only limited to adding/removing elements and rendering them only from DOM and not modifying other properties
I tried modifying scroll-anchor property but still no success, as svelte was still scrolling as soon as the new event appears.
Can you please help me with any ideas or suggestions using which we can implement this?
@aditygrg2 I will give it a try after work. Sounds odd that this is a problem with Svelte 🤔
Have a look how it can be solve in #22
Yes, got it, it was simple, I was going the tough way. Closing this as the PR related to this issue #22 is there already.
Added support for stopping events when scrolled, and re-starting on clicking on an button.
Issue : https://github.com/glaslos/ochi/issues/20