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-checkbox custom icons removed?

    Help
    7
    18
    2175
    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.
    • R
      rusia last edited by

      I can see that in v1.beta there is no support anymore for q-checkbox checked-icon and unchecked-icon props as it was in v0.17
      Are they removed forever?
      This feature is indispensable for my app. Can you suggest some workaround?

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

        Can you give an example or two of how it is indispensable?

        Scott

        1 Reply Last reply Reply Quote 0
        • R
          rusia last edited by

          I’m building something like a multi-track music editor. I use check-boxes with custom icons for triggering mute and solo states for tracks.
          In v0.17 it looked nice:
          0_1550934833546_8a88fbba-dde3-4941-9f24-6e2239418a4e-image.png

          Now in v1.beta it’s just horrible:
          0_1550934964685_63f3370d-d951-48e0-a29d-de6490b2409d-image.png

          Of course, I believe it’s possible to create a workaround for this using q-btn instead of q-checkbox. But it would be just a workaround with a lot of extra unnecessary code. With checkboxes it’s a very short and comfortable code:

          <div v-for="(track, index) in tracks" :key="index">
            <div>
              <q-checkbox v-model="trackUnmuted[index]" checked-icon="volume_mute" unchecked-icon="volume_off" @input="mute(index, $event)"/>
            </div>
            <div>
              <q-checkbox v-model="trackSolo[index]" checked-icon="strikethrough_s" unchecked-icon="strikethrough_s" @input="solo(index, $event)"/>
            </div>
          </div>
          

          I really have no idea why you decided to drop this feature. It is very useful and convenient. So if possible please re-enable it again.

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

            Ok. I see what you mean now and thank you for the explanation.

            I can suggest a few things.

            1. Create an issue on Github asking for this feature again.

            2. Create your own toggle button component with a button, as you mentioned. You only need to create the component once and it really isn’t that hard. Then you can use your custom toggle button component wherever you need it.

            3. Have a look at QBtnToggle. Since you are given an array prop for the button definitions, that might be an easier way to create your custom toggle button(s). 😄

            Scott

            1 Reply Last reply Reply Quote 0
            • R
              rusia last edited by

              Thanks for your response.
              I created an issue linking to this topic.
              To create a custom toggle button component is a good idea, I’ll consider this. I also thought of using some css trick like that: https://codepen.io/imohkay/pen/wyxuB
              But, of course, I’d prefer this feature to be re-enabled in quasar. That would be the best option 😄
              By the way, do you have any idea why it was dropped? Nobody used it? Or any other reason?

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

                Nope. No idea what happened to that feature of the toggle.

                Scott

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

                  1. suggestion, as Razvan said on Github, use QToggle.

                  Scott

                  1 Reply Last reply Reply Quote 0
                  • R
                    rusia last edited by

                    Yes, Razvan said that in order for an accurate Material Design on checkboxes, this feature had to be dropped, and suggested using QToggle with icons.
                    I tried QToggle and it worked but the look of it didn’t satisfy me.
                    So I finally decided to create a workaround.
                    I used plain html <input type="checkbox"/> and styled it with FontAwesome icons as shown in this codepen https://codepen.io/imohkay/pen/wyxuB
                    Now it looks and works just like q-checkbox with custom icons in quasar v0.17
                    Anyway, thanks for you help, it is much appreciated!

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

                      I played around some with QToggleButton. 😄

                      https://codepen.io/smolinari/pen/jJEBVe

                      Scott

                      1 Reply Last reply Reply Quote 0
                      • R
                        rusia last edited by

                        Your example looks cool!
                        However QBtnToggle is essentially a radio input but I need a checkbox style on/off boolean switch. That’s why I decided to use plain html input tag instead of Quasar element.

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

                          Well, you can control what you’d like with it and change the icons with a function, theoretically. 😄

                          Scott

                          1 Reply Last reply Reply Quote 0
                          • U
                            uberpu last edited by

                            I’m using the QChip… (plus it has a “selected” option built in.
                            I know this example could be simpler, but hey, It got changed into a mini component.
                            Handles bind, plus horizontal, plus option or checkbox option.
                            https://codepen.io/uberpu/pen/QoNQXz

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

                              I was also using this option with q-radio and sad to see it go.

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

                                You can still do it. You have now the power to do anything you want with the option slot.

                                https://v1.quasar-framework.org/vue-components/select#Customizing-menu-options

                                Scott

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

                                  I also used this for like/dislike buttons and a heart favorite button. I agree sad to see this convenience go

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

                                    my solution is simple

                                    <q-btn v-if="userFavorited" @click="setFavorite" flat round color="white" text-color="red" icon="favorite" />
                                    <q-btn v-if="!userFavorited" @click="setFavorite" flat round color="white" text-color="red" icon="favorite_border" />
                                    
                                    metalsadman 1 Reply Last reply Reply Quote 0
                                    • metalsadman
                                      metalsadman @mitchellmonaghan last edited by

                                      @mitchellmonaghan said in q-checkbox custom icons removed?:

                                      my solution is simple

                                      <q-btn v-if="userFavorited" @click="setFavorite" flat round color="white" text-color="red" icon="favorite" />
                                      <q-btn v-if="!userFavorited" @click="setFavorite" flat round color="white" text-color="red" icon="favorite_border" />
                                      

                                      You can do a one liner with that ie.
                                      ... :icon="userFavorited ? 'favorite' : 'favorite_border'" ... or use a computed prop.

                                      1 Reply Last reply Reply Quote 0
                                      • Hawkeye64
                                        Hawkeye64 last edited by

                                        If using a button, add the flat property for better results

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