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

    QInput in QRadio loses focus after release a mouse button

    Help
    3
    5
    73
    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.
    • I
      Innoel last edited by

      I have this code in template:

           <q-form @submit="submitForm">
              <q-input
                outlined
                use-input
                type="phone"
                id="phone"
                v-model="device_input"
                label="Введите модель устройства..."
              />
              <q-list link>
                <q-item tag="label">
                  <q-item-section avatar>
                    <q-radio v-model="segment_input" val="дисп" />
                  </q-item-section>
                  <q-item-section>
                    <q-item-label>Дисплей</q-item-label>
                  </q-item-section>
                </q-item>
      
                ...
      
                <q-item tag="label">
                  <q-item-section avatar>
                    <q-radio v-model="segment_input" val="text" />
                  </q-item-section>
                  <q-item-section>
                    <q-input type="input" dense @focus="segment_input = 'text'" v-model="segment_text" />
                  </q-item-section>
                </q-item>
              </q-list>
              <q-btn class="full-width q-mt-md" color="secondary" type="submit">рассчитать</q-btn>
            </q-form>
      

      It looks:
      form.png

      And when I release the mouse button after selection, QInput immediately loses focus.

      Maybe I chose the wrong way to implement this idea?

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        Are you trying to make a single selection with radio buttons? Like this?

        https://codepen.io/smolinari/pen/dybrmBo?&editable=true&editors=101

        It doesn’t make complete sense to have radios inside a QInput.

        Scott

        I 1 Reply Last reply Reply Quote 0
        • I
          Innoel @s.molinari last edited by Innoel

          @s-molinari No, vice versa. I wanna put QInput inside label of radio, can I?

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

            @Innoel use @click.stop on your q-input, like so https://codepen.io/metalsadman/pen/MWgxBxB?&editable=true&editors=101.

            1 Reply Last reply Reply Quote 0
            • s.molinari
              s.molinari last edited by

              And add v-close-popup on the other radios, if you want the menu to close on selection of the radio.

              Scott

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