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'],
mounted() {
this.$refs.element.appendChild(this.element);
setTimeout(() => {
this.getElementForFocus().focus();
}, 0);
const element = this.$refs.element;
element.appendChild(this.element);
const elementForFocus = this.getElementForFocus() || element;
this.$nextTick(() => {
elementForFocus.focus();
});
},
methods: {
destroy: function () {