Skip to content

Commit 81bfde7

Browse files
committed
Remove focus-trap ➖
1 parent 62a8b1a commit 81bfde7

File tree

6 files changed

+44
-22630
lines changed

6 files changed

+44
-22630
lines changed

client/admin/components/common/ConfirmationDialog.vue

+5-10
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
</template>
1616

1717
<script>
18-
import { withFocusTrap } from '@/common/focustrap';
19-
20-
const el = vm => vm.$children[0].$refs.dialog;
21-
2218
export default {
2319
name: 'confirmation-dialog',
24-
mixins: [withFocusTrap({ el })],
2520
props: {
2621
visible: { type: Boolean, default: false },
2722
heading: { type: String, default: '' },
2823
message: { type: String, default: 'Are you sure?' },
2924
action: { type: Function, default: () => true }
3025
},
26+
data() {
27+
return {
28+
focusTrap: null
29+
};
30+
},
3131
computed: {
3232
show: {
3333
get() {
@@ -48,11 +48,6 @@ export default {
4848
this.$emit('confirmed');
4949
});
5050
}
51-
},
52-
watch: {
53-
show(val) {
54-
this.$nextTick(() => this.focusTrap.toggle(val));
55-
}
5651
}
5752
};
5853
</script>

client/admin/components/users/ImportDialog.vue

+1-10
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@
7575
<script>
7676
import api from '@/admin/api/user';
7777
import saveAs from 'save-as';
78-
import { withFocusTrap } from '@/common/focustrap';
79-
80-
const el = vm => vm.$children[0].$refs.dialog;
8178
8279
const inputFormats = {
8380
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',
@@ -86,7 +83,6 @@ const inputFormats = {
8683
8784
export default {
8885
name: 'import-dialog',
89-
mixins: [withFocusTrap({ el })],
9086
data: () => ({
9187
showDialog: false,
9288
importing: false,
@@ -113,8 +109,8 @@ export default {
113109
},
114110
close() {
115111
if (this.importing) return;
112+
if (this.$refs.fileInput) this.$refs.fileInput.value = null;
116113
this.filename = null;
117-
this.$refs.fileInput.value = null;
118114
this.resetErrors();
119115
this.showDialog = false;
120116
},
@@ -147,11 +143,6 @@ export default {
147143
this.error = null;
148144
this.$refs.form?.reset();
149145
}
150-
},
151-
watch: {
152-
showDialog(val) {
153-
this.$nextTick(() => this.focusTrap.toggle(val));
154-
}
155146
}
156147
};
157148
</script>

client/admin/components/users/UserDialog.vue

-5
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ import humanize from 'humanize-string';
8080
import isEmpty from 'lodash/isEmpty';
8181
import map from 'lodash/map';
8282
import { Role } from '@/../common/config';
83-
import { withFocusTrap } from '@/common/focustrap';
84-
85-
const el = vm => vm.$children[0].$refs.dialog;
8683
8784
const resetUser = () => {
8885
return {
@@ -95,7 +92,6 @@ const resetUser = () => {
9592
9693
export default {
9794
name: 'user-dialog',
98-
mixins: [withFocusTrap({ el })],
9995
props: {
10096
visible: { type: Boolean, default: false },
10197
userData: { type: Object, default: () => ({}) }
@@ -137,7 +133,6 @@ export default {
137133
},
138134
watch: {
139135
show(val) {
140-
this.$nextTick(() => this.focusTrap.toggle(val));
141136
if (!val) return;
142137
this.$refs.form?.reset();
143138
if (!isEmpty(this.userData)) this.user = cloneDeep(this.userData);

client/common/focustrap.js

-22
This file was deleted.

0 commit comments

Comments
 (0)