Skip to content

Commit

Permalink
Drawer: fix focus bug (ElemeFE#20626)
Browse files Browse the repository at this point in the history
Co-authored-by: wp178491 <wp178491@alibaba-inc.com>
  • Loading branch information
2 people authored and hzsrc committed Feb 2, 2023
1 parent 2b3eb64 commit adfa4a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/drawer/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
>
<header class="el-drawer__header" id="el-drawer__title" v-if="withHeader">
<slot name="title">
<span role="heading" tabindex="0" :title="title">{{ title }}</span>
<span role="heading" :title="title">{{ title }}</span>
</slot>
<button
:aria-label="`close ${title || 'drawer'}`"
Expand All @@ -49,7 +49,6 @@
<script>
import Popup from 'element-ui/src/utils/popup';
import emitter from 'element-ui/src/mixins/emitter';
import Utils from 'element-ui/src/utils/aria-utils';
export default {
name: 'ElDrawer',
Expand Down Expand Up @@ -133,9 +132,6 @@ export default {
document.body.appendChild(this.$el);
}
this.prevActiveElement = document.activeElement;
this.$nextTick(() => {
Utils.focusFirstDescendant(this.$refs.drawer);
});
} else {
if (!this.closed) this.$emit('close');
this.$nextTick(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/theme-chalk/src/drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ $directions: rtl, ltr, ttb, btt;
0 16px 24px 2px rgba(0, 0, 0, 0.14),
0 6px 30px 5px rgba(0, 0, 0, 0.12);
overflow: hidden;
outline: 0;

@each $direction in $directions {
@include animation-out($direction);
Expand Down

0 comments on commit adfa4a0

Please sign in to comment.