Questions tagged [focus]
Focus indicates the component of the graphical user interface which is currently selected to receive input.
focus
7,330
questions
3172
votes
54
answers
831k
views
How to stop EditText from gaining focus when an activity starts in Android?
I have an Activity in Android, with two elements:
EditText
ListView
When my Activity starts, the EditText immediately has the input focus (flashing cursor). I don't want any control to have input ...
1814
votes
11
answers
2.9m
views
How to remove focus border (outline) around text/input boxes? (Chrome) [duplicate]
Can anyone explain how to remove the orange or blue border (outline) around text/input boxes? I think it only happens on Chrome to show that the input box is active. Here's the input CSS I'm using:
...
733
votes
25
answers
413k
views
Is there a way to detect if a browser window is not currently active?
I have JavaScript that is doing activity periodically. When the user is not looking at the site (i.e., the window or tab does not have focus), it'd be nice to not run.
Is there a way to do this using ...
548
votes
49
answers
479k
views
How to show soft-keyboard when edittext is focused
I want to automatically show the soft-keyboard when an EditText is focused (if the device does not have a physical keyboard) and I have two problems:
When my Activity is displayed, my EditText is ...
436
votes
8
answers
542k
views
How to reset / remove chrome's input highlighting / focus border? [duplicate]
I have seen that chrome puts a thicker border on :focus but it kind of looks off in my case where I've used border-radius also. Is there anyway to remove that?
433
votes
18
answers
467k
views
Android: Force EditText to remove focus? [duplicate]
I would like to be able to remove the focus from the EditText. For example if the Keyboard appears, and the user hides it with the back button, I would like the focus and the cursor to disappear. How ...
431
votes
13
answers
1.1m
views
How can I set focus on an element in an HTML form using JavaScript?
I have a web form with a text box in it. How do I go about setting focus to the text box by default?
Something like this:
<body onload='setFocusToTextBox()'>
so can anybody help me with it? I ...
334
votes
8
answers
535k
views
Is it possible to focus on a <div> using JavaScript focus() function?
Is it possible to focus on a <div> using JavaScript focus() function?
I have a <div> tag
<div id="tries">You have 3 tries left</div>
I am trying to focus on the above <...
332
votes
7
answers
202k
views
Which HTML elements can receive focus?
I'm looking for a definitive list of HTML elements which are allowed to take focus, i.e. which elements will be put into focus when focus() is called on them?
I'm writing a jQuery extension which ...
298
votes
12
answers
520k
views
How to focus on a form input text field on page load using jQuery?
This is probably very simple, but could somebody tell me how to get the cursor blinking on a text box on page load?
289
votes
18
answers
156k
views
Prevent the keyboard from displaying on activity start
I have an activity with an Edit Text input. When the activity is initialized, the Android keyboard is shown. How can the keyboard remain hidden until the user focuses the input?
262
votes
6
answers
280k
views
jQuery lose focus event
I'm trying to show up a container if a input field gets the focus and - that's the actual problem - hide the container if focus is lost. Is there an opposite event for jQuery's focus?
Some example ...
251
votes
35
answers
211k
views
In React ES6, why does the input field lose focus after typing a character?
In my component below, the input field loses focus after typing a character. While using Chrome's Inspector, it looks like the whole form is being re-rendered instead of just the value attribute of ...
245
votes
9
answers
268k
views
How do you clear the focus in javascript?
I know this shouldn't be that hard, but I couldn't find the answer on Google.
I want to execute a piece of javascript that will clear the focus from whatever element it is on without knowing ahead of ...
242
votes
24
answers
124k
views
Focus-follows-mouse (plus auto-raise) on Mac OS X
(I don't want to hear about how crazy I am to want that! :)
Focus-follows-mouse is also known as point-to-focus, pointer focus, and (in some implementations) sloppy focus. [Add other terms that will ...