switched to using ngprime multiselect in library and watchlist pages

This commit is contained in:
X4Lo committed 2024-09-10 19:00:49 +01:00
1 parent 4fbbc4b113
commit c5883cf6f5
14 files changed
+285 -233

No files matched your search

@@ -0,0 +1,24 @@
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[appStopScroll]',
})
export class StopScrollDirective {
constructor(private el: ElementRef) {}
@HostListener('wheel', ['$event'])
onWheel(event: WheelEvent) {
const element = this.el.nativeElement;
// Check if scrolling is at the top or bottom of the element
const atTop = element.scrollTop === 0;
const atBottom =
element.scrollHeight - element.scrollTop === element.clientHeight;
// Prevent scrolling the page if scrolling is within the dropdown
if ((atTop && event.deltaY < 0) || (atBottom && event.deltaY > 0)) {
event.stopPropagation();
event.preventDefault();
}
}
}