Skip to content

Commit 9195e7c

Browse files
fix: dialog auto focus
1 parent 292f9da commit 9195e7c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Dialog.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:width="width"
88
:shift-y="0.3"
99
:adaptive="true"
10-
:focus-trap="true"
10+
:focus-trap="autoFocus"
1111
:clickToClose="clickToClose"
1212
:transition="transition"
1313
@before-open="beforeOpened"
@@ -50,6 +50,10 @@ export default {
5050
},
5151
transition: {
5252
type: String
53+
},
54+
focusTrap: {
55+
type: Boolean,
56+
default: false
5357
}
5458
},
5559
inject: ['$modal'],
@@ -70,6 +74,9 @@ export default {
7074
return {
7175
flex: `1 1 ${100 / this.buttons.length}%`
7276
}
77+
},
78+
autoFocus() {
79+
return this.params.autoFocus ?? this.focusTrap;
7380
}
7481
},
7582
methods: {

0 commit comments

Comments
 (0)