Questions tagged [focus]
Focus indicates the component of the graphical user interface which is currently selected to receive input.
focus
948
questions
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 ...
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:
...
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 ...
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 <...
33
votes
6
answers
39k
views
Panel not getting focus
I am continuing to program some kind of keyboard navigation in my simple graphic program (using C#). And I ran into trouble once again.
My problem is that I want to process the keyboard input to move ...
82
votes
12
answers
119k
views
How to make a Tkinter window jump to the front?
How do I get a Tkinter application to jump to the front? Currently, the window appears behind all my other windows and doesn't get focus.
Is there some method I should be calling?
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 ...
2
votes
2
answers
12k
views
How can I run code in a background thread and still access the UI?
I made a file search program in visual studio on windows 10 using .net lang,
My problem starts from form1 with a "dim frm2 as form2 = new form2" call,
after the new form being shown i start a while ...
58
votes
6
answers
93k
views
Mobile Safari Autofocus text field
In Mobile Safari I am unable to focus onto a text field after setting a delay period. I'm attaching some example code showcasing the issue.
If, onclick of the button, you trigger .focus(), everything ...
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 ...
90
votes
10
answers
165k
views
Mobile Safari: Javascript focus() method on inputfield only works with click?
I have a simple input field like this.
<div class="search">
<input type="text" value="y u no work"/>
</div>
And I'm trying to focus() it inside a function.
So inside of a ...
4
votes
3
answers
5k
views
Selenium switch focus to tab, which opened after clicking link
For automation purposes, I am working on creating a script that finds a row in a table. This row is clickable and opens a new tab/adress.
With selenium, I am now able to find the table row, click on ...
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 ...
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 ...