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

    keep focus on textarea after button click

    Framework
    1
    1
    151
    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.
    • V
      VadimNad last edited by

      Please advice how to keep focus on textarea element after clicking q-btn.

      Tried to apply preventDefault

      <q-btn @click.prevent="handleClick" label="click me" />
      

      and stopPropagation

      <q-btn @click.stop="handleClick" label="click me" />
      

      But in any case textarea losses the focus after click. I know that focus can be returned back to textarea using focus() but on mobile it causes side effect like blinking embedded keyboard.

      I can reach desired result by replacing q-btn with simple div and using mousedown event instead of click. Maybe there is a workaround to implement similar behavior with q-btn?

      Codepen: https://codepen.io/olegef/pen/NWNvxJM

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