Skip to content
Permalink
Browse files

fix(MdSteppers): recalculate styles on window resize (#1394)

* fix(MdSteppers): overflow on resize

* refactor(MdSteppers): add beforeDestroy hook to remove resize listener
  • Loading branch information...
Samuell1 authored and marcosmoura committed Jan 12, 2018
1 parent edb484e commit d3953f734f733298144f199f2309df16a077c21b
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/components/MdSteppers/MdSteppers.vue
@@ -186,6 +186,8 @@
if ('ResizeObserver' in window) {
this.resizeObserver = new window.ResizeObserver(this.calculateStepperPos)
this.resizeObserver.observe(this.$el)
} else {
window.addEventListener('resize', this.calculateStepperPos)
}
if (steppersContent) {
@@ -244,7 +246,12 @@
this.setupObservers()
this.setupWatchers()
}, 100)
}
},
beforeDestroy () {
if (!('ResizeObserver' in window)) {
window.removeEventListener('resize', this.calculateStepperPos)
}
},
})
</script>

0 comments on commit d3953f7

Please sign in to comment.
You can’t perform that action at this time.