mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 04:37:47 +08:00
fix(components): [switch] tabindex property doesn't work (#8101)
This commit is contained in:
parent
4ef6ee28a8
commit
4c34660c59
@ -42,6 +42,15 @@ describe('Switch.vue', () => {
|
||||
expect(wrapper.find('.el-switch--large').exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('tabindex', () => {
|
||||
const wrapper = mount(Switch, {
|
||||
props: {
|
||||
tabindex: '0',
|
||||
},
|
||||
})
|
||||
expect(wrapper.find('.el-switch__input').attributes().tabindex).toBe('0')
|
||||
})
|
||||
|
||||
test('inline prompt', () => {
|
||||
const wrapper = mount(Switch, {
|
||||
props: {
|
||||
|
@ -93,6 +93,9 @@ export const switchProps = buildProps({
|
||||
type: String as PropType<ComponentSize>,
|
||||
validator: isValidComponentSize,
|
||||
},
|
||||
tabindex: {
|
||||
type: [String, Number],
|
||||
},
|
||||
} as const)
|
||||
|
||||
export type SwitchProps = ExtractPropTypes<typeof switchProps>
|
||||
|
@ -12,6 +12,7 @@
|
||||
:true-value="activeValue"
|
||||
:false-value="inactiveValue"
|
||||
:disabled="switchDisabled"
|
||||
:tabindex="tabindex"
|
||||
@change="handleChange"
|
||||
@keydown.enter="switchValue"
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user