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

    Enter-Event in q-search component not triggered

    Help
    3
    7
    3697
    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
      tonyskulk last edited by

      I am using a q-search along with an q-autocomplete component like this:

      <q-autocomplete ref="autoComplete" v-model="searchModel" :delay="0" @search="searchAndSuggest" :max-results="3" :min-characters="1" @selected="selected">
        <q-search v-model="searchModel" placeholder="Zutaten" @enter="test()"></q-search>
      </q-autocomplete>
      

      …
      methods: {
      test () {
      console.log(‘enter pressed’)
      this.$refs.autoComplete.close()
      },
      …

      But unfortunalety the @enter event is not gonna be triggered.
      From the docs:
      @enter Triggered when Enter key is detected.

      How can I get that enter key pressed event?

      Thanks,
      Tony

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by rstoenescu

        Hi, @enter="test" (notice no ending () ) --> otherwise you execute test() and the result (in this case undefined) is assigned as @enter handler.

        1 Reply Last reply Reply Quote 0
        • T
          tonyskulk last edited by tonyskulk

          Unfortunately this does not work either.
          In a simplified scenario with just a <q-search>-component I also can not trigger method call:

            <q-search v-model="searchModel" placeholder="Enter search text..." @input="search" @enter="search"></q-search>
          

          with method:

          search () {
          console.log(‘search triggered’)
          }

          1 Reply Last reply Reply Quote 0
          • rstoenescu
            rstoenescu Admin last edited by

            I just tested it and it works. What Quasar version (full string) are you using?

            1 Reply Last reply Reply Quote 0
            • T
              tonyskulk last edited by

              It´s “quasar-framework”: “^0.13.4”. Maybe I should update this…

              1 Reply Last reply Reply Quote 0
              • M
                manelclos last edited by

                Hi, Quasar framework 0.14.3, the enter event for the return key is not fired.

                1 Reply Last reply Reply Quote 0
                • rstoenescu
                  rstoenescu Admin last edited by rstoenescu

                  This is an old thread. Quasar v0.14 has @keydown and @keyup events emitted, so no longer needing a @enter event.
                  Always check documentation. Point @keydown to a function with one parameter (which will be the event itself), so check if it’s Enter key there.

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