Topic: mdb-select: selected value is not updated when blur event is fired
eladhr83 free asked 4 years ago
*_Expected behavior_*Get selected value from v-model when blur event is fired:
- The user selecting an option from the select
- Blur event is fired
- The value of v-model is old
*_Actual behavior_*The value that I am getting from the v-model is the old value one when the blur event is fired.
Resources (screenshots, code snippets etc.)\
<template>
<mdb-select v-model="states" @Blur="onBlur()"></mdb-select>
</template>
<script lang="ts">
states={text:'France',selected:false,text:'Israel',selected:false}
onBlur() {
// do something like read v-model
// and get the old value
}
</script>
Magdalena Dembna staff answered 4 years ago
The event you should use in this case instead of @blur
is @getValue
- blur event is fired when the main input loses focus, not when the value gets selected. Kind regards, Magdalena
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Vue
- MDB Version: 6.3.0
- Device: pc
- Browser: chrome
- OS: ubuntu
- Provided sample code: No
- Provided link: No