Questions tagged [focus]

Focus indicates the component of the graphical user interface which is currently selected to receive input.

focus
2,277 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
28 votes
0 answers
165 views

The Focus of the Default Sharing Window

I'm using a command-line tool called terminal-share to use the macOS's system sharing service. The tool's code can be found here: https://github.com/mattt/terminal-share/ But, there is one little ...
guitarpoet's user avatar
11 votes
0 answers
8k views

Testing for focused element with jest 25.x

We use jest tests with expect(document.activeElement).toBe(myElement) pattern to determine if an element got correctly focused after an interaction. After upgrading to jest 25 (jsdom 15) all such ...
Eszter's user avatar
  • 111
9 votes
2 answers
986 views

Camera AF_TRIGGER_START doesn't start focusing onTouch

i have a camera app using camera2 Api, i implemented onTouchListener to the TextureView i use for Previewing from Camera, what i want is when a user taps the screen to be able to focus on that area ...
Homombi's user avatar
  • 133
9 votes
1 answer
1k views

Focus outline doesn't appear when focused programmatically?

if I have a <div tabindex="1" id="mydiv">content</div> I can click on it, it will show an outline, and document.activeElement points to this element. However, if I run document....
Andrew Dutcher's user avatar
8 votes
1 answer
630 views

FocusState Textfield not working within toolbar ToolbarItem

Let me explain, I have a parent view with a SearchBarView, im passing down a focus state binding like this . SearchBarView(searchText:$object.searchQuery, searching: $object.searching, focused: ...
lorenzo gonzalez's user avatar
8 votes
0 answers
419 views

Does CameraX support macro focus?

I am currently trying to implement a functionality for macro focus in Android. Both, Camera1 API and Camera2 API offer the possibility for FOCUS_MODE_MACRO/AF_MACRO. For CameraX, I found ...
D. Muff's user avatar
  • 213
7 votes
2 answers
1k views

Disable showModal auto-focusing using HTML attributes

As I am aware, the showModal() method runs the following steps which end up focusing elements within an HTML dialog (emphasis mine) : Let subject be the dialog element on which the method was invoked....
Shnick's user avatar
  • 1,321
7 votes
1 answer
1k views

Why does IE and Edge ignore a whole CSS rule?

Consider the following CSS rule: input:focus, div:focus-within { box-shadow: none !important; } This rule overwrites Bootstrap's input box-shadow on focus and also a focus contained within a ...
Studocwho's user avatar
  • 2,461
7 votes
1 answer
2k views

Copy plain text with no rich styles to clipboard without losing focus?

I looked at this question where it is asked for a way to simply copy text as plain text. I want to do exactly that but with one additional thing - not lose focus on the current element. I need this ...
dodov's user avatar
  • 5,460
7 votes
0 answers
3k views

focus() method and event order (in pure JavaScript)

I am currently working on a large web project with a sophisticated help system and therefore need an in-depth understanding of when events are fired synchronously or asynchronously, respectively. ...
Binarus's user avatar
  • 4,115
7 votes
0 answers
598 views

How to keep sticky window from always getting focus in awesome wm

In the awesome window manager the focused window of a tag regains its focus when switching back and forth between tags, i.e. by pressing Mod+[Number] or selecting them in the top bar. Now when a ...
bodo's user avatar
  • 1,045
7 votes
0 answers
835 views

Radio Group not getting Focus in Android

So I have a form that contains two EditText components and a RadioGroup. When I click on one of the EditText fields the keyboard pops-out and I can right and everything is great. UNTIL I click on one ...
Mohamed Sobhy's user avatar
6 votes
0 answers
447 views

Focus window using VS Code API

I'm developing an extension for Visual Studio Code, and I'd like to focus the application window using the VS Code API at a certain point in the execution. I've been digging through the VS Code and ...
andypopa's user avatar
  • 536
6 votes
0 answers
687 views

Android - Recycler View Focuses Wrong Holder on EditText click

I have a Recycler View to show a list of data and have edit text inside of Recycler View to allow user edit some number. My app also resizing activity when the keyboard is shown/hidden. The app ...
Mohamed's user avatar
  • 1,271
6 votes
1 answer
360 views

Android camera focusing only once

We are developing an app for the Vuzix M100, which should continuously read a barcode and display the result in a textView. Therefore, the camera takes a picture every 5 seconds and sends the bitmap ...
LBre's user avatar
  • 61
6 votes
1 answer
953 views

Identifying the origin of a focus request in Java Swing UI

I have a problem with a Swing application whereby focus will sometimes be gained by a text entry field for reasons that I am currently unable to identify. I suspect a race condition of some sort but I ...
PhilDin's user avatar
  • 2,832
6 votes
3 answers
1k views

Android , Admob / Adview takes|steals focus from edittext , How to prevent?

I am creating views and add these views to a linearlayout , These input is taken from edittext at the bottom of the screen like a messanger application. Whenever i push the 'done' button it triggers ...
Suat KARAKUSOGLU's user avatar
6 votes
1 answer
2k views

How to get current focus view object in Service?

How can i get the current focus view in my Service. I found some methods to do this, like Activity.getCurrentFocus() and Windows.getCurrentFocus(). But these methods are used in a Activity. If I ...
Muthumani's user avatar
  • 115
6 votes
2 answers
389 views

How to recover tabOrder after switching `windowFlags` of some widgets in Qt?

Context: For a custom widget, similar to a menu, I have some of the content inside a "drop-down" frame when space is not sufficient: For this drop-down feature, I set the frame for those ...
Adrian Maire's user avatar
  • 14.7k
6 votes
1 answer
753 views

Why does not PredictFocus() support FocusNavigationDirection.Next?

What are the reasons for PredictFocus() does not support FocusNavigationDirection.Next ? And how can I get the element to recieve focus when TAB is hit?
Pavel Voronin's user avatar
5 votes
0 answers
6k views

input field focus issue with chakra-ui

I'm building a simple form in chakra-ui with a controlled field. Whenever the user types in an input after a single keystroke focus moves to the next field. I think there's a bug with react re-...
dcsan's user avatar
  • 11.8k
5 votes
1 answer
3k views

Focus-stacking using OpenCV / Emgu CV

I have a C# (Emgu CV) application where I capture mutliple images of the same scene at varying focal lengths. Now I want to create a multifocus image simular like described in this article http://blog....
Simon's user avatar
  • 51
5 votes
1 answer
2k views

Multiple onFocusChange receive

I'm struggling with a listview filled with EditText for quiet some time, and I can't find a way to achieve my task without doing something tricky. I used a minimized project to make it simpler and ...
Quentin Beuvelet's user avatar
5 votes
0 answers
494 views

WPF: Restore keyboard focus after re-enabling container

I have a Window with a Grid with two TextBoxes in it. One of them has keyboard focus. If I disable the Grid and then re-enable it some time later, the keyboard focus is not restored to the TextBox ...
Marin Bonacci's user avatar
5 votes
1 answer
2k views

How to test whether an input form field is focussed?

For the following sign-up form I configured that the first input field with id="signUpName" is focused when the form is rendered. Backbone-forms is used to create the form. I want to test with ...
JJD's user avatar
  • 50.7k
5 votes
2 answers
1k views

iOS Bug? Unable to change text in a select when focused using jQuery

I am using a select with optgroups for some navigation on mobile devices. I use the optgroup's label to indicate the section it belongs in - and then the option itself to designate the sub-section. ...
Todd Gilbert's user avatar
5 votes
1 answer
547 views

ListView in SlidingDrawer loses focus after onResume

I use a SlidingDrawer as my main layout. Inside the content area I have a Fragment (which contains a ListView) When the activity first loads everything is great, the listview scrolls correctly. When ...
Leo's user avatar
  • 4,661
5 votes
0 answers
2k views

Stopping table & td elements from getting focus

In IE it seems that table & td elements will automatically receive focus on a mouse click. Taken from http://msdn.microsoft.com/en-us/library/ms534654%28VS.85%29.aspx The following elements ...
AJ.'s user avatar
  • 11k
5 votes
2 answers
4k views

return focus from iframe to parent

I have some keyboard shortcuts binded to the document object using the keydown event (I am using the jquery.hotkeys plugin to do this, but I doubt this matters). I then have an iframe which I insert ...
annam's user avatar
  • 51
5 votes
1 answer
761 views

how to keep sliding drawer off the top of the virtual keyboard

I've been scratching my head all day over this. on one of my activities (and only one) when i call up the virtual keyboard the sliding drawer handle appears above it. i managed to fix this problem on ...
iHorse's user avatar
  • 113
5 votes
0 answers
367 views

How can I set the initially focused element without activating the window (WPF)?

My program creates a window with ShowActivated=false, so that it doesn't steal keyboard focus when it's opened (the window is created in response to events coming over the network). I want to be able ...
vanmelle's user avatar
  • 1,605
5 votes
1 answer
1k views

My PopupWindow keeps stealing my EditText's focus

I have a simple "command dialog" that's a PopupWindow containing an EditText and a couple of buttons. I want the following behavior: Touching outside the popup window dismisses it When the popup ...
Stevey's user avatar
  • 3,091
5 votes
2 answers
4k views

Angular 2 Focus Form Element

I created a form with angular 2 and now i want to add some form validation. The validation is working but now i want to focus on to the form elements. Is this possible in angular 2. What I have found ...
Snake's user avatar
  • 323
4 votes
1 answer
2k views

How to set focus to button in react and material ui on Dialog properly?

When I used code : <DialogActions> <Button onClick={handleClose}>Disagree</Button> <Button onClick={handleClose} autoFocus&...
Armin66's user avatar
  • 49
4 votes
0 answers
221 views

Android. Unexpected fade (dim) background after lost focus

I observe a strange effect in various scenarios, which boil down to the fact that after the EditText loses focus, the background of the application is faded (dimmed). I have attached link to the ...
HaronDDC's user avatar
4 votes
0 answers
335 views

mate desktop environment marco window manager window focus not working

I am running : fedora32 mate desktop environment wayland marco window manager xterm emacs -nw (text mode) emacs dired+ mode emacs "openwith" mode When I start up "emacs -nw" in ...
William Garber's user avatar
4 votes
2 answers
3k views

Next focus on custom view inside RecyclerView

I have RecyclerView that represent forms. These RecyclerView are made of multiple type of View. Each of them has a base_layout and specific View depending on the data-type they represent (eg: a string ...
MHogge's user avatar
  • 5,068
4 votes
1 answer
390 views

Android EditText click navigation wrong

In the pictures below you can see 2 EditText nicely standing next to each-other. When I click on one EditText, it navigates me to the view (no problem). But when I click on the EditText next to it, ...
BrianM's user avatar
  • 949
4 votes
0 answers
823 views

HTML5 Drag not working with Chrome if there is a focused input password element in the page

In the following example the input password element prevents any drag operation with Chrome if the password element is focused before the drag. The text "My div text" cannot be dragged into the ...
John Middlemas's user avatar
4 votes
1 answer
683 views

Can't catch lasting focus on specific recyclerview item position

I'm trying to set focus on specific item in recyclerview like: recyclerview.scrollToPosition(positionX); adapter.notifyDataSetChanged(); I can see for a milisecond that I get focus on desired item ...
JoshuaMad's user avatar
  • 587
4 votes
0 answers
306 views

UIButton in tvOS 9.1: focused state image not displayed

I have 3 buttons (name Button A, Button B and Button C). In storyboard, I have added images for normal, focused and selected state. Now suppose Button B is selected by default and its selected image ...
GAURAV VIG's user avatar
4 votes
0 answers
512 views

Alt Gr key gives menu focus when I don't expect it to

Several keyboards have a Alt Gr key. On my Swedish keyboard layout, to enter the [ character I have to press Alt Gr + 8 (or Ctrl + Alt + 8). If I were to input this character twice in a JavaFX ...
Simon Forsberg's user avatar
4 votes
0 answers
492 views

manually trigger on screen keyboard for touch devices on contenteditable field

I have a web app with some contenteditable fields. When they receive focus I would like to trigger the on screen keyboard but it is not appearing. I've even tried to overlay some invisible input ...
mheavers's user avatar
  • 29.8k
4 votes
0 answers
1k views

iOS How to detect focus change between textfields in custom keyboard?

I am making a custom keyboard and i want to change my keyboard layout to adapt to the UITextField type (url, websearch, email) every time user change the focus between textfields. For example: ...
TomSawyer's user avatar
  • 3,804
4 votes
0 answers
1k views

How to move the focus to required field in xml during onchange event odoo?

I want move the focus of the field to desired field during a on change event. Is it possible in odoo8 without altering the core code?. Image - Field Focus
Sathiyan S's user avatar
4 votes
0 answers
852 views

Android Descendants focus within a scrollview

I have multiple components within a LinearLayout under a parent ScrollView. The structure of my layout is something like below:- <ScrollView> <LinearLayout> <ImageView/> <...
hello world's user avatar
4 votes
1 answer
283 views

wxButton still looking selected after next button gets selected

There are several wxButton on the panel. wxButton blinks when it is focused, but after a new button gets selected, previous does not stop to blink. Only two of them are looking selected, e.g. if third ...
mdinic's user avatar
  • 75
4 votes
2 answers
1k views

Focus event triggers input event in IE vs modern browsers

How to prevent input event firing after focus/set Selection Range event in IE? Code example here: var setSelectionRange = function (input, selectionStart, selectionEnd) { if (input....
user avatar
4 votes
0 answers
3k views

How to trigger (window).focus on page load?

When the page is loaded the focus/blur state isn't activated. When switching to for example another tab blur show, and upon switching back to the page focus activates – but at first load of the page ...
Lenny's user avatar
  • 446
4 votes
0 answers
795 views

Set keyboard focus to a QInputDialog with Python PySide

I have QSystemTray which when is double clicked creates a QInputDialog box to input a text. such as: password, ok = QtGui.QInputDialog.getText(None, "Password", "Password:", QtGui.QLineEdit.Password)...
NoobTom's user avatar
  • 565

1
2 3 4 5
46