moreta / vue-search-select

A Vue.js search select component
https://vue-search-select.netlify.com
MIT License
402 stars 127 forks source link

The 'blur' event is not emitted by the ModelListSelect component. #185

Closed lffv closed 1 year ago

lffv commented 1 year ago

Issue Description

The ModelListSelect component in Vue.js is not emitting the expected 'blur' event, as documented.

Summary: The ModelListSelect component, according to the documentation, should emit a 'blur' event when it loses focus. However, currently, the 'blur' event is not being emitted by the component.

Expected Behavior: When the ModelListSelect component loses focus, it should emit a 'blur' event.

Current Behavior: The 'blur' event is not being emitted by the ModelListSelect component when it loses focus.

Steps to Reproduce:

  1. Create a ModelListSelect component instance.
  2. Interact with the component (e.g., click on the dropdown options, select an item).
  3. Verify that the 'blur' event is not emitted when the component loses focus.

Relevant Code:

<template>
  <ModelListSelect @blur="handleBlur" />
</template>

<script>
export default {
  methods: {
    handleBlur() {
      console.log('Blur event triggered');
    }
  }
}
</script>

Steps to fix it:

At ModelListSelect.vue:

...
import common from "./common.js"
...

methods : {
     onBlur() {
      common.blurInput(this)
    },
}
...
onBlur: this.onBlur,