diff --git a/docs/pages/components/modal/examples/ExProgrammatic.vue b/docs/pages/components/modal/examples/ExProgrammatic.vue index 05320bc9f..3bf8f9014 100644 --- a/docs/pages/components/modal/examples/ExProgrammatic.vue +++ b/docs/pages/components/modal/examples/ExProgrammatic.vue @@ -65,7 +65,8 @@ parent: this, component: ModalForm, hasModalCard: true, - customClass: 'custom-class custom-class-2' + customClass: 'custom-class custom-class-2', + trapFocus: true }) } } diff --git a/src/components/modal/Modal.vue b/src/components/modal/Modal.vue index a49c0df45..17ab876ea 100644 --- a/src/components/modal/Modal.vue +++ b/src/components/modal/Modal.vue @@ -135,14 +135,14 @@ export default { watch: { active(value) { this.isActive = value + }, + isActive(value) { + this.handleScroll() this.$nextTick(() => { if (value && this.$el && this.$el.focus) { this.$el.focus() } }) - }, - isActive() { - this.handleScroll() } }, methods: {