Skip to content

Commit 17b0d20

Browse files
oliver-niSamuell1
andauthored
fix(MdStep): set tabindex for not active step (#2215)
* fix(MdStep): set tabindex for not active step * feat(MdStep): add v-show to hide content Co-authored-by: Samuell1 <[email protected]>
1 parent 1a8052f commit 17b0d20

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/MdSteppers/MdStep.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="md-stepper">
33
<md-step-header v-if="MdSteppers.isVertical" :index="id" />
44

5-
<div class="md-stepper-content" :class="{ 'md-active': !MdSteppers.syncRoute && id === MdSteppers.activeStep }">
5+
<div :class="['md-stepper-content', { 'md-active': isActive }]" :tabindex="tabIndex" v-show="isActive">
66
<slot />
77
</div>
88
</div>
@@ -43,6 +43,16 @@
4343
}
4444
}
4545
},
46+
computed: {
47+
isActive () {
48+
return this.id === this.MdSteppers.activeStep
49+
},
50+
tabIndex () {
51+
return !this.isActive
52+
? -1
53+
: false
54+
}
55+
},
4656
methods: {
4757
getPropValues () {
4858
const propNames = Object.keys(this.$options.props)

0 commit comments

Comments
 (0)