Skip to content

Commit

Permalink
#837 - Fixing scroll component
Browse files Browse the repository at this point in the history
  • Loading branch information
graphefruit committed Nov 11, 2024
1 parent c8e9cd9 commit 8812ff6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/app/brew/associated-brews/associated-brews.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,18 @@ export class AssociatedBrewsComponent {
const el = this.associatedBrewsComponent.nativeElement;
const scrollComponent: AgVirtualSrollComponent =
this.openScrollAssociatedBrews;
scrollComponent.el.style.height =
el.offsetHeight - scrollComponent.el.offsetTop - 20 + 'px';

this.segmentScrollHeight = scrollComponent.el.style.height;
setTimeout(() => {
/** If we wouldn't do it, and the tiles are collapsed, the next once just exist when the user starts scrolling**/
const elScroll = scrollComponent.el;
elScroll.dispatchEvent(new Event('scroll'));
}, 15);

if (scrollComponent) {
scrollComponent.el.style.height =
el.offsetHeight - scrollComponent.el.offsetTop - 20 + 'px';

this.segmentScrollHeight = scrollComponent.el.style.height;
setTimeout(() => {
/** If we wouldn't do it, and the tiles are collapsed, the next once just exist when the user starts scrolling**/
const elScroll = scrollComponent.el;
elScroll.dispatchEvent(new Event('scroll'));
}, 15);
}
}, 150);
}

Expand Down

0 comments on commit 8812ff6

Please sign in to comment.