fix(components): [select select-v2] fix input click event (#15462)

* fix(components): [select] fix input click event

* fix(components): update
This commit is contained in:
kooriookami
2024-01-12 16:04:53 +08:00
committed by GitHub
parent 479c25b5fa
commit 1afb276ddd
3 changed files with 8 additions and 5 deletions

View File

@@ -159,7 +159,7 @@
@keydown.enter.stop.prevent="onKeyboardSelect"
@keydown.esc.stop.prevent="handleEsc"
@keydown.delete.stop="handleDel"
@click.stop
@click.stop="toggleMenu"
/>
<span
v-if="filterable"

View File

@@ -818,7 +818,8 @@ describe('Select', () => {
)
const select = wrapper.findComponent({ name: 'ElSelect' })
const selectVm = select.vm as any
await select.trigger('click')
const input = wrapper.find('input')
await input.trigger('click')
expect(selectVm.states.hoveringIndex).toBe(0)
selectVm.navigateOptions('next')
expect(selectVm.states.hoveringIndex).toBe(1)
@@ -896,7 +897,8 @@ describe('Select', () => {
})
const select = wrapper.findComponent({ name: 'ElSelect' })
const selectVm = select.vm as any
await select.trigger('click')
const input = wrapper.find('input')
await input.trigger('click')
expect(selectVm.states.hoveringIndex).toBe(0)
selectVm.navigateOptions('next')
expect(selectVm.states.hoveringIndex).toBe(1)
@@ -929,7 +931,8 @@ describe('Select', () => {
)
const select = wrapper.findComponent({ name: 'ElSelect' })
const selectVm = select.vm as any
await select.trigger('click')
const input = wrapper.find('input')
await input.trigger('click')
expect(selectVm.states.hoveringIndex).toBe(1) // index 0 was skipped
selectVm.navigateOptions('next')

View File

@@ -159,7 +159,7 @@
@compositionupdate="handleCompositionUpdate"
@compositionend="handleCompositionEnd"
@input="onInput"
@click.stop
@click.stop="toggleMenu"
/>
<span
v-if="filterable"