Typescript logic that works in v3 doesn't work in v4

I’m having trouble with a piece of code that I wrote. You can check it out here on stackblitz

The logic works perfectly in v3 of Ionic, but in v4, it’s impossible to scroll through the content without the screen freezing and glitching. Any idea why this might be?

Thanks in advance