fixed console error with save + using this.$nextTick instead of setTimeout. (#2516)

This commit is contained in:
Nikhil
2019-11-21 08:32:42 -08:00
committed by Andrew Henry
parent cab51f2665
commit 8825a458dc

View File

@ -182,10 +182,12 @@
}, },
inject: ['dismiss', 'element', 'buttons', 'dismissable'], inject: ['dismiss', 'element', 'buttons', 'dismissable'],
mounted() { mounted() {
this.$refs.element.appendChild(this.element); const element = this.$refs.element;
setTimeout(() => { element.appendChild(this.element);
this.getElementForFocus().focus(); const elementForFocus = this.getElementForFocus() || element;
}, 0); this.$nextTick(() => {
elementForFocus.focus();
});
}, },
methods: { methods: {
destroy: function () { destroy: function () {