Home

Issue: 1498

After updating to `latest` scroll binding stopped working

[issue link]

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!

This question is available on Nuxt.js community (#c1334)