Skip to content

Commit adfa4a0

Browse files
cs1707wp178491
authored andcommitted
Drawer: fix focus bug (ElemeFE#20626)
Co-authored-by: wp178491 <[email protected]>
1 parent 2b3eb64 commit adfa4a0

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

packages/drawer/src/main.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
>
2727
<header class="el-drawer__header" id="el-drawer__title" v-if="withHeader">
2828
<slot name="title">
29-
<span role="heading" tabindex="0" :title="title">{{ title }}</span>
29+
<span role="heading" :title="title">{{ title }}</span>
3030
</slot>
3131
<button
3232
:aria-label="`close ${title || 'drawer'}`"
@@ -49,7 +49,6 @@
4949
<script>
5050
import Popup from 'element-ui/src/utils/popup';
5151
import emitter from 'element-ui/src/mixins/emitter';
52-
import Utils from 'element-ui/src/utils/aria-utils';
5352
5453
export default {
5554
name: 'ElDrawer',
@@ -133,9 +132,6 @@ export default {
133132
document.body.appendChild(this.$el);
134133
}
135134
this.prevActiveElement = document.activeElement;
136-
this.$nextTick(() => {
137-
Utils.focusFirstDescendant(this.$refs.drawer);
138-
});
139135
} else {
140136
if (!this.closed) this.$emit('close');
141137
this.$nextTick(() => {

packages/theme-chalk/src/drawer.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ $directions: rtl, ltr, ttb, btt;
119119
0 16px 24px 2px rgba(0, 0, 0, 0.14),
120120
0 6px 30px 5px rgba(0, 0, 0, 0.12);
121121
overflow: hidden;
122+
outline: 0;
122123

123124
@each $direction in $directions {
124125
@include animation-out($direction);

0 commit comments

Comments
 (0)