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

    q-select tab key

    Framework
    2
    7
    854
    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
      thescript last edited by

      q-select pressing tab key will clear the current value and move on to the next component/element.

       <q-select label="Recipients"
                                v-model="recipients"
                                use-input
                                use-chips
                                multiple
                                hide-dropdown-icon
                                input-debounce="0"
                                new-value-mode="add-unique"
                                stack-label
                                @new-value="newValue">
      </q-select>
      
      

      How to prevent this behavior or somehow customize the q-select component to accept tab key have the same function as the Enter key?

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @thescript last edited by

        @thescript use a listener @keydown.tab="handler".

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

          @metalsadman thank you, how to retain the value being inputted , does that be inside the event handler?

          metalsadman 1 Reply Last reply Reply Quote 0
          • metalsadman
            metalsadman @thescript last edited by metalsadman

            @thescript take note of this https://quasar.dev/vue-components/select#Keyboard-navigation, and hereโ€™s how you do it https://codepen.io/metalsadman/pen/jOMexgy?editors=101. i donโ€™t get what you mean by retain the value being inputted, if you want to keep what you typed then just comment out this line this.$refs.sel.updateInputValue('').

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

              @metalsadman thank you for the example it helps me a lot. How about if you input a value and then you clicked outside of the q-select/component, how to retain the value being inputted? would the mouseleave or mouseout events would suffice with this kind of implementation?

              metalsadman 1 Reply Last reply Reply Quote 0
              • metalsadman
                metalsadman @thescript last edited by metalsadman

                @thescript same concept as above, just different listener something like @blur then using updateInputValue(currentInputValue). Check out the api https://quasar.dev/vue-components/select#QSelect-API.

                T 1 Reply Last reply Reply Quote 0
                • T
                  thescript @metalsadman last edited by

                  @metalsadman thank you!๐Ÿ‘Š๐Ÿป ๐Ÿ‘Œ๐Ÿป

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