-
Notifications
You must be signed in to change notification settings - Fork 138
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
scroll when dragging #117
Comments
Anyone have suggestions on how to do this? This would be very beneficial to me as well |
Set a timer function when dragging, |
You can try https://github.com/hollowdoor/dom_autoscroller |
@jzahka Can you please provide a code example? Or did it just work out of the box? |
I more or less copied the example in the repo https://github.com/hollowdoor/dom_autoscroller#usage import autoScroll from 'dom-autoscroller';
// ...
constructor(private element: ElementRef) {}
// ...
ngAfterViewInit() {
autoScroll([
this.element.nativeElement // element needs to be scrollable
], {
margin: 50,
maxSpeed: 20,
autoScroll: function() {
// only scroll when mouse is down
// `this` does not refer to component here
return this.down;
}
});
} |
Do you have performance problems at home with ngx-dnd and dom_autoscroll? I made a kind of board like Trello (much lighter in terms of features), I added dom_autoscroll to scroll vertically and horizontally but the interface is very jerky. Do you have the same problem? |
@GitHubish I haven't had the jerky interface issue you describe. |
I did a test project, the problem arises as soon as there are a certain number of elements displayed. In my case with an interface without CSS, without any other complexity / heaviness caused by other components, animations jerk with 250 elements. |
@jzahka how do you destroy when leaving the component? |
@jzahka @GitHubish |
Hey @hijoncon |
I believe you can use |
If i have a large number of items the container can't scroll at own
The text was updated successfully, but these errors were encountered: