5

I am not able to use vue on blur event, In my component I have a @change directive

<b-input :value="value" @change="validateEmail($event)" @input="$emit('input', $event)" ref="input" :state="state"/>

This is because @blur doesn't seem to work. Bootstrap vue on:blur handler is not been called

This works partially when I am changing the input and hit tab, then works, but if I focus on the input and click tab without changing the input, it doesn't work. I want to show a message that email is required in this case but I cannot.

1
  • 2
    Did you try @blur.native="..."? Never tried, but since your b-input is a vue component, it may be related with native events.
    – Sergeon
    Commented Nov 19, 2018 at 13:14

2 Answers 2

5

You may use @blur.native with Bootstrap Vue inputs.

<b-input
        :value="value"
        @change="validateEmail($event)"
        @input="$emit('input', $event)"
        ref="input"
        :state="state"

        @blur.native="handleBlur"

/>

https://github.com/bootstrap-vue/bootstrap-vue/issues/1645#issuecomment-369477878

1

you can use @blur.native="function"

1
  • You should add a link to the documentation to spice up your anwer!
    – m02ph3u5
    Commented Jul 24, 2019 at 15:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.