No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    @input not trigger when changing the value of model q-select

    Help
    q-select quasar reactivity
    2
    3
    1578
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      thekingrenz23 last edited by

      q-select
      	class="q-mb-md"
          dense
          outlined
          v-model="region"
          @filter="filterRegion"
          use-input
          input-debounce="0"
          :options="regionOptions"
          hint="Region"
          label="Select Region"
          bottom-slots
          :loading="loadingRegion"
          @input="loadProvince"
          :rules="[ val => !!val || 'Region is required']"
          >
          <template v-slot:no-option>
              <q-item>
                  <q-item-section class="text-grey">
                      No results
                  </q-item-section>
              </q-item>
          </template>
      </q-select>
      

      changing the value of region does not trigger @input event

      this.region  = {
       	value: “test”,
      	label: “test”
      }
      //this will not trigger @input event
      
      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @thekingrenz23 last edited by dobbel

        @thekingrenz23

        changing the value of region does not trigger @input event

        That’s intended behavior. @input only watches changes initiated from the q-select component, not from other code.

        If you want to trigger on changes of the region data value you could use Vue’s watch mechanism:

        watch: {
                region: {
                    deep: true  // because 'region' contains nested values
                    handler: function(newValue, oldValue) {
                        console.log("newValue: " + newValue)
                    }
                 }
            }
        
        T 1 Reply Last reply Reply Quote -1
        • T
          thekingrenz23 @dobbel last edited by

          @dobbel thanks a lot for the explanation and tips on how to solve it

          1 Reply Last reply Reply Quote 0
          • First post
            Last post