mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
fix(components): [select] binding click event is invalid (#17876)
* fix(components): [select] binding click event is invalid closed #17863 * chore: typo
This commit is contained in:
parent
c2ad4f222c
commit
2f69776b30
@ -1867,4 +1867,16 @@ describe('Select', () => {
|
||||
// after deletion, an el-tag still exist
|
||||
expect(wrapper.findAll('.el-tag').length).toBe(1)
|
||||
})
|
||||
|
||||
it('should be trigger the click event', async () => {
|
||||
const handleClick = vi.fn()
|
||||
const wrapper = _mount(`<el-select :options="[]" @click="handleClick" />`, {
|
||||
methods: {
|
||||
handleClick,
|
||||
},
|
||||
})
|
||||
|
||||
await wrapper.find(`.${WRAPPER_CLASS_NAME}`).trigger('click')
|
||||
expect(handleClick).toHaveBeenCalledOnce()
|
||||
})
|
||||
})
|
||||
|
@ -34,7 +34,7 @@
|
||||
nsSelect.is('filterable', filterable),
|
||||
nsSelect.is('disabled', selectDisabled),
|
||||
]"
|
||||
@click.prevent.stop="toggleMenu"
|
||||
@click.prevent="toggleMenu"
|
||||
>
|
||||
<div
|
||||
v-if="$slots.prefix"
|
||||
|
@ -2731,4 +2731,14 @@ describe('Select', () => {
|
||||
expect(wrapper.findAll('.el-tag')[1].text()).toBe('1')
|
||||
})
|
||||
})
|
||||
|
||||
it('should be trigger the click event', async () => {
|
||||
const handleClick = vi.fn()
|
||||
const wrapper = _mount(`<el-select @click="handleClick" />`, () => ({
|
||||
handleClick,
|
||||
}))
|
||||
|
||||
await wrapper.find(`.${WRAPPER_CLASS_NAME}`).trigger('click')
|
||||
expect(handleClick).toHaveBeenCalledOnce()
|
||||
})
|
||||
})
|
||||
|
@ -34,7 +34,7 @@
|
||||
nsSelect.is('filterable', filterable),
|
||||
nsSelect.is('disabled', selectDisabled),
|
||||
]"
|
||||
@click.prevent.stop="toggleMenu"
|
||||
@click.prevent="toggleMenu"
|
||||
>
|
||||
<div
|
||||
v-if="$slots.prefix"
|
||||
|
Loading…
Reference in New Issue
Block a user