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

    QSelect behaviour different from HTML Select

    Help
    1
    3
    71
    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.
    • P
      pwfraley last edited by

      Hi,

      I noticed the QSelect behaves different from deault HTML select.

      I have a select: maritalStatus, which is a uid. The Options for the Select look like this:

      [
        {
          id: UID,
          shortText: 'maried'
        },
        {
          id: UID,
          shortText: 'divorced'
        }
      ]
      

      In the Dropdown of the select everything works fine (it shows the ShortText), but in the Input it shows the option-value and not like in HTML the option-label.

      <q-select v-model="personFormModel.maritalStatus" @input-value="savePerson" emit-value :options="maritalStatus" option-value="id" option-label="shortText" options-cover label="Familienstand" />
      

      Sorry the Screenshot is in German 😉

      Bildschirmfoto-20210308114724-619x506.png

      How can I get the qselect to behave like a regular HTML Select, where the SelectedValue would display the label and not the value?

      1 Reply Last reply Reply Quote 0
      • P
        pwfraley last edited by

        QuasarVersion: 2.0.0-beta.8

        1 Reply Last reply Reply Quote 0
        • P
          pwfraley last edited by

          Ok I figured it out. I was missing the “map-options” in the Select. After adding this it worked like expected 🙂

          <q-select for="maritalStatus" v-model="personFormModel.maritalStatus" @update:modelValue="savePerson" map-options emit-value :options="maritalStatus" option-value="id" option-label="shortText" label="Familienstand" />
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post