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

    Is it possible to use q-input with mask for complex structured input?

    Framework
    2
    3
    4236
    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
      tdumitr last edited by

      I’d like to use the q-input, if possible for taking input such as point 3d or vector. This would be represented as a 3 float array or as a 6 or 7 float array. For a point 3d, the mask may look something like:

      [#.#, #.#, #.#]
      

      For each coordinate, I would like to be able to accept any number of digits before and after the period. I would also like to have the [], characters fixed in the mask. In other words, I would like the input to have them prepopulated, with the cursor between the [ and the first , when first entering the control. I would also like the cursor to jump to the next float number when the user hits the , key.

      Following the credit card input example in the docs, I got the input to display and skip the [], characters, but I cannot make it accept any number of digits for a single # character in the mask. Is there any other way to accomplish this?

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

        @tdumitr list of masks are seen here https://quasar.dev/vue-components/input#Mask , other combo, either you use a third party https://quasar.dev/vue-components/input#Using-third-party-mask-processors , or roll out your own.

        you can assign it like here https://codepen.io/metalsadman/pen/YzyawzO?editable=true&editors=101%3Dhttps%3A%2F%2Fquasar.dev%2Fvue-components%2Finput , but you will have to do your own logic based on your explanation. use a ref and target the inner input to get the native functions to control the cursor. Or check the helper script found here https://github.com/quasarframework/quasar/blob/dev/ui/src/mixins/mask.js#L2.

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

          @metalsadman: Thank you. I will give it a try.

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