[SOLVED] Programatic focus on input element (searchbar)


#1

Dear all,

it sounds pretty simple, but unfortunately I did not found a solution.

Page:
https://framework7.io/docs-demos/core/searchbar.html

How to but the focus on the search field? I tried

$(’.searchbar-input-wrap input’).focus()

without success (chrome developer console).

Any solution?

Many thanks
Andreas


#2

Hello,
Any solution?


#3

Sorry for the late response…

Yes, the mistake was on my side. I used simply

$(’#id_input_element’).focus();

Certrainly you can use any other selector. So far I tried in Android 7.0 and it works.

My mistake was that I first tried it on a PC (Chrome) + console. Result was that the focus was always immediatly remove (because of active
the console).

best regards
Andreas


#4

Thanks Andreas, is solved.