Static GitHub Issues

[1498] After updating to `latest` scroll binding stopped working

prev: fetch () is pre-populating static files on nuxt generate
next: Got an hydration error when use vue-portal

Hello. After I upgrade Nuxt my code broke.

I have this in template

< header @scroll="handleScroll" :class="[{'headroom--unpinned': scrolled 'default-header': zeroscrolled} header]"></header>

script

methods: {
    handleScroll: function () {
      if (!this.activeOverlay && this.lastPosition < window.scrollY && this.limitPosition < window.scrollY) {
        this.scrolled = true
        // move up!
      }
      if (this.lastPosition > window.scrollY) {
        this.scrolled = false
        this.zeroscrolled = false
        // move down
      }
      if (this.$route.path === '/' && this.zeroScroll < window.scrollY) {
        this.zeroscrolled = true
      }
      this.lastPosition = window.scrollY
    }
  },
  created () {
    if (process.BROWSER_BUILD) {
      // window.onNuxtReady(() => {
      window.addEventListener('scroll', this.handleScroll)
      // })
    }
  },
  destroyed () {
    if (process.BROWSER_BUILD) {
      // window.onNuxtReady(() => {
      window.removeEventListener('scroll', this.handleScroll)
      // })
    }
  }

What changes was made? What can cause the issue? All was working perfectly hour ago!

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1334">#c1334</a>)</em></sub></div>