Questions tagged [autofocus]
456 questions
121
votes
4 answers
Setting focus on an HTML input box on page load
I'm trying to set the default focus on an input box when the page loads (example: google).
My page is very simple, yet I can't figure out how to do this.
This is what I've got so far:
Password Protected Page

secr
- 624
- 4
- 9
- 20
18
votes
2 answers
Can I use autofocus on an element with contenteditable?
I'm using the contenteditable attribute on a
in order to make it act as a text field on demand (for users to rename something). But I want to enable autofocus on it as well, so users can begin typing immediately (the
always has…

daGUY
- 27,055
- 29
- 75
- 119
17
votes
4 answers
iPhone : camera autofocus observer?
I would like to know if it's possible to receive notification about autofocus inside an iPhone application?
I.E, does it exist a way to be notified when autofocus starts, ends, if it has succeed or failed... ?
If so, what is this notification name ?

Sly
- 2,105
- 5
- 22
- 28
17
votes
8 answers
Ionic v4 - how do I autofocus on a Input?
I have a view with an input
How can I auto focus on this input?
What have I tried
@ViewChild('codigobarras') input_codigobarras: Input;
...
ionViewDidEnter() {
this.input_codigobarras.focus(); // didn't…

SpaceDogCS
- 2,808
- 3
- 20
- 49
16
votes
1 answer
Flash of unstyled content (FOUC) in Firefox when using 'autofocus' in input field
Actually, this is more of an error description than a question.
I noticed flash of unstyled content (FOUC) in Firefox on a very simple login page. There are no images used. No heavy CSS. All Javascript placed at the end of the code, right before the…

Christian
- 325
- 2
- 10