Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export default VSelect.extend({
isFocused (val) {
if (val) {
document.addEventListener('copy', this.onCopy)
this.$refs.input && this.$refs.input.select()
} else {
document.removeEventListener('copy', this.onCopy)
this.blur()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,29 +404,6 @@ describe('VAutocomplete.ts', () => {
expect(wrapper.vm.lazySearch).toBeNull()
})

it('should select input text on focus', async () => {
const wrapper = mountFunction({
attachToDocument: true,
})
const select = jest.fn()
wrapper.vm.$refs.input.select = select

const input = wrapper.find('input')
input.trigger('focus')

await wrapper.vm.$nextTick()

expect(wrapper.vm.isFocused).toBe(true)
expect(select).toHaveBeenCalledTimes(1)

input.trigger('keydown.tab')

await wrapper.vm.$nextTick()

expect(wrapper.vm.isFocused).toBe(false)
expect(select).toHaveBeenCalledTimes(1)
})

it('should not respond to click', () => {
const onFocus = jest.fn()
const wrapper = mountFunction({
Expand Down