How to "set" Focus in an onClick function?

Asked

Viewed 38 times

1

How do I leave an element focused by clicking on it?

example

At the moment I am making a filter page that has some buttons, but these buttons only work if I double click. (The onClick function inside them gets an Handle, which arrow the useState to true and runs a const to sort the contacts and handle the created filters). It works normally, but I need to double-click.

I believe that the first click is Focus and the second yes is setting and running.

I would like to know how I can do this. I put something inside Handle? I create a function apart and put it inside an onFocus?

  • Already penou in using the event dbclick? In JSX, the property is called onDoubleClick.

1 answer

0

Without the code it’s kind of hard to understand what you want to do, if you can put the code it helps the community a lot to help you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.