C
C
Canis_Lupus2019-07-03 17:53:21
Bootstrap
Canis_Lupus, 2019-07-03 17:53:21

How to autofocus a text field in dropdown when clicking on a link?

It is necessary that when the link is clicked, the autofocus field pops up - https://jsfiddle.net/95hg4d8j/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karvasarny, 2019-07-04
@Canis_Lupus

setTimeout(() => {
searchblock.focus();
},0);
so do it or similar, it turns out you press focus () works, but the element has not yet appeared and it works in nowhere))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question