lusaxweb / vuesax

New Framework Components for Vue.js 2
https://lusaxweb.github.io/vuesax/
MIT License
5.63k stars 744 forks source link

vs-alert: Cannot read property 'scrollHeight' of undefined" #555

Open Cuacha07 opened 5 years ago

Cuacha07 commented 5 years ago

Getting an error on vs-alert component when "active" prop is false.

[Vue warn]: Error in nextTick: "TypeError: Cannot read property 'scrollHeight' of undefined" found in ---> at vsAlert.vue

mjmnagy commented 5 years ago

getting the same thing

resolved by wrapping alert in container with v-show but that eliminates the need for active and is redundant

pSYrOOs commented 4 years ago

same issue but v-show didn't help me

at the moment, the only solution that I found is to comment out a the next piece of code in vuesax.common.js , VsAlert component into mounted: var _this = this; this.$nextTick(function () { var h = _this.$refs.alert.scrollHeight; _this.$refs.alert.style.height = h + 'px'; });

I know that this is not entirely correct, but so far this is the only way that has solved the error problem for me

codebydino commented 4 years ago

Same issue here, when vs-alert is inside v-if...v-else it throws this error.