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

    Set q-search clearable icon

    Framework
    3
    6
    782
    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
      toymachiner62 last edited by

      I’d like to set to change the icon that appears on q-select when clearable="true". I don’t see a configuration to do this. The only thing I can think of is to use :before and specify an icon and a function to basically perform the functionality of clearable="true".

      Am i correct in that i’ll have to manually implement this or is there an easier way?

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

        That is correct. You can use before or after to create your own clearing icon button. That is one of the ideas behind the before and after props.The clearable prop is just a simpler way to get a clearing function for use in those 80% of use cases that need it.

        Scott

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

          Feature request to add an attribute for clearable icon!

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

            the :before and :after can have icon property, just don’t set clearable in your q-search. https://quasar-framework.org/components/search.html

            :after="[{
              // required icon
              icon: String,
              // required function to call when
              // icon is clicked/tapped
              handler: Function, // do your clear here
            
              // Optional. Show icon button
              // if model has a value
              content: Boolean,
            
              // Optional. Show icon button
              // if textfield is marked with error
              error: Boolean
            }]"
            1 Reply Last reply Reply Quote 1
            • s.molinari
              s.molinari @toymachiner62 last edited by

              @toymachiner62 said in Set q-search clearable icon:

              Feature request to add an attribute for clearable icon!

              And then an attribute to have it on the left and not the right. And then an attribute to get a different pull-down arrow showing, and then an attribute to get the pull-down arrow to show on the left…the list of ideas can go on and on. Point is, with the two slots (before and after) you can basically do anything you want. Instead of bloating up the select with more props, the two slots give you the opportunity to create your own select components with whatever additional buttons you want and you only need to create the component one time.

              Scott

              1 Reply Last reply Reply Quote 1
              • T
                toymachiner62 last edited by

                Fair enough

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