question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Events (keyup & change)

See original GitHub issue

version - v2.0.0-rc.6 change

<template>
  <div>
    <b-form-select v-model="selected" :options="options" class="mb-3" />
    <b-form-select v-model="selected" :options="options" class="mb-3" size="sm" @change="log(selected)" />
    <div>Selected: <strong>{{ selected }}</strong></div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      selected: null,
      options: [
        { value: null, text: 'Please select an option' },
        { value: 'a', text: 'This is First option' },
        { value: 'b', text: 'Selected Option' },
        { value: {'C': '3PO'}, text: 'This is an option with object value' },
        { value: 'd', text: 'This one is disabled', disabled: true }
      ]
    }
  },
  methods: {
    log (val) {
      console.log(val)
    }
  }
 }
</script>

default As you see, model in template change correct, but in console log old value.

keyup

<template>
  <div>
    <b-form-input v-model="text1"
                  type="text"
                  placeholder="Enter your name"
                  @keyup.enter="log('b-form-input')"></b-form-input>
<input v-model="text1"
                  type="text"
                  placeholder="Enter your name"
                  @keyup.enter="log('simple input')"/> 
<p>Value: {{ text1 }}</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      text1: ''
    }
  },
  methods: {
    log (val) {
     console.log(val);
   }
  }
 }
</script>

keyup works only in simple input.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mosinvecommented, Apr 11, 2018

hi, try to use @keyup.enter.native, and please let us know the result

0reactions
emanuelmutschlechnercommented, Apr 16, 2018

@Hanyuusha You’re welcome. Please close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery: Do I need both keyUp and change events?
When do you want the values to update? change and keyup are different events, and you might use both of them. – Bergi....
Read more >
jQuery keyup() Method - W3Schools
The order of events related to the keyup event: ... The keyup event occurs when a keyboard key is released. The keyup() method...
Read more >
.keyup() | jQuery API Documentation
The keyup event is sent to an element when the user releases a key on the keyboard. It can be attached to any...
Read more >
jQuery keyup change event - CodePen
1. var keyup_count = 0; ; 2. var change_count = 0; ; 3. $('#input1').keyup(function(){ ; 4. keyup_count++; ; 5. $('#log_keyup').html('keyup:'+keyup_count).
Read more >
jQuery - text input field - change keyup and paste events
jQuery can be used to handle these events on an input text field. change (when text input field changes and loses focus)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found