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

    [SOLVED] Getting textarea current cursor position

    Help
    2
    3
    136
    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.
    • O
      OrthoCube last edited by OrthoCube

      I’m trying to create my own in-app keyboard used for inputting custom characters to the textarea, however, it’s not possible to insert characters in the middle of the input by detecting the position of the cursor and inserting the character there.

      Getting cursor position (and selected text position) seems to be possible in plain HTML/JS using something like this

      var cursorPosition = $('#myTextarea').prop("selectionStart");
      

      but I can’t see how I can implement that on a <q-input>.

      Is there any way to get the current cursor position (or selected position) from a q-input?

      Thanks in advance.

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

        @OrthoCube https://forum.quasar-framework.org/topic/4702/how-to-get-the-cursor-position-form-q-input/5

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

          @metalsadman Thank you very much! Didn’t see that when I searched.

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