Questions tagged [focus]
Focus indicates the component of the graphical user interface which is currently selected to receive input.
focus
7,326
questions
0
votes
0
answers
12
views
How to manually set focus on element in a shadow DOM (Lit Web Component)
I'm building a select/dropdown component as a Lit web component. To have consistent styling, this is NOT using a native select. I'm using divs and adding logic to have them appear when and where ...
0
votes
0
answers
10
views
React 18 content editable field focus issue
I am working on a quiz application where answers to a question are managed with content editable. I use React 18 for front-end development. I use Dummy options(id= 0) to add options faster and allow ...
0
votes
1
answer
27
views
using :focus without a button or link?
Is it possible to use :focus without having a button or link to focus something? I'm trying to put the code into a game which "doesn't allow" buttons and when I try using <a href="#&...
0
votes
2
answers
45
views
Lost focus on one input effects all inputs
I have created an application form with a validation function that requires the user to input the correct information within the boxes before clicking away from that focused box or an error message ...
0
votes
1
answer
34
views
using :focus to show something with a button
I have a question regarding :focus. I want to have a button/text that shows <div class="contentbox2"> when clicked, but i'm really struggling with that. I tried several ways but i can ...
0
votes
0
answers
19
views
Compose focus requester never works
Despite all the examples here, even the hacky solutions using a delay, nothing seems to work.
The focus needs to happen on recomposition when an error flag is true validating a username or a password. ...
1
vote
1
answer
38
views
Prevent focus on specific elements jQuery
OK, I have a weird need. I'm not trying to trap focus inside of a specific div, I'm trying to prevent it from entering specific other ones. I have a script which changes the class on a div from "...
-1
votes
1
answer
35
views
Website no longer recognizes popup window name. Javascript
Tell me if this makes any sense. I have been accessing a website through a popup window for years. using
window.open('https://example.com',mypopup,parameters);
I click a button in my main window, and ...
0
votes
0
answers
27
views
Pressing "enter" focuses on the dialog instead of the other fields
On my main page, I render a table that shows some orders. When the user clicks on any of the orders, a Dialog opens up with an additional table showing the products related to the order.
The first two ...
0
votes
1
answer
22
views
SwiftUI Checkbox focus ring too large and off-center--is this bug?
This code demonstrates the problem: the checkbox's focus ring is too large and off-center on macOS 14.5. (I haven't checked other macOS versions. Also note, this is not an iOS question.)
import ...
2
votes
1
answer
244
views
How to prevent my window from gaining input focus?
I am implementing an AutoComplete, but one that will match text anywhere in the list of enumerated strings—rather than just the beginning of a suggestion as is the behavior of the built-in ...
1
vote
0
answers
58
views
How to fix cursor behaviour in custom TextField in Flutter?
I have created a custom TextField, where there need to be the following things:
The possibility to pass a custom controller, so that when the user scans a barcode, I can update the text with the ...
0
votes
0
answers
15
views
Selectize force blur when using keyboard navigation
I'm trying to add and remove a focus class to selectize but i can't seem to get it to work at all when navigating using a keyboard only. It works fine when using a mouse.
var focusEvent = function () {...
0
votes
2
answers
105
views
.Net Maui Android cannot hide keyboard
UPDATED - Trimmed down user control:
using CommunityToolkit.Maui.Core.Platform;
using CommunityToolkit.Mvvm.Input;
using System.Diagnostics;
namespace GSL.Presentation.CustomControls;
public partial ...
0
votes
1
answer
50
views
Find out which field in SAP has focus / is the active field with VBA (Excel)
I write scripts in VBA to change data via SAP GUI. I can easily set focus to a defined field in SAP GUI (e.g. Session.FindById("wnd[0]/usr/ctxt[2]").SetFocus). But how can I find out what ...
-2
votes
0
answers
55
views
SwiftUI: Changing ListView Row Background Color Based on Focus During Scrolling
I'm trying to change the background color of rows in a ListView while scrolling in SwiftUI. I've attempted the following code, but it's not working as expected
List {
ForEach(viewModel.menuItems) {...
0
votes
0
answers
16
views
Compose Focus Order Not making any sense
I have a pretty basic layout.
val focusRequesters = List(3) { FocusRequester() }
Column(
modifier = Modifier.
focusProperties {
next = focusRequesters[0]
}
) {
Box ...
2
votes
1
answer
44
views
How do I set focus on a div in React in order to trigger an effect with onBlur?
I'm working on a pretty basic note taking app with React. Purely a front end question.
On a sidebar I have a list of all the current notes, which the user can use to swap between them. Each note ...
0
votes
0
answers
23
views
scrollIntoView not working when the component is out of focus, on chromium based browsers
I'm building a react single page app and have noticed that the scrollIntoView function does not work on chrome based browsers (tested on edge&chrome) when the component is out of focus.
I have a ...
0
votes
0
answers
48
views
How to control focus events in tkinter with root.overrideredirect(True)?
Details:
Python 3.12.3
The tkinter <FocusOut> event should be triggered when the window looses focus. This works just fine in normal windows, but when I do root.overrideredirect(True), the ...
0
votes
0
answers
6
views
input type date focus color change
How to change the input type date focus default color blue to some other color. The default focus color is coming blue. how to change the mm selected default blue color. The default blue color coming ...
0
votes
0
answers
36
views
SwiftUI AccessibilityFocusState not working in Lists
I have a view shown as a crouton (from bottom view) when tapping a button. I want to move accessibility focus to this view when shown but using AccessibilityFocusState only works if the button is NOT ...
0
votes
0
answers
30
views
NVDA overrides eventListeners on arrow keys 38 and 40 with its own behavior for that
The "handleAccordionKeyDown" function enables arrow key navigation in an accordion.
If the first accordion element, a link, is focused with the tab key, arrow key navigation is activated.
...
0
votes
0
answers
78
views
How to properly pass destinations to a TVFocusGuideView in React Native
I'm having trouble with focus redirection using TVFocusGuideView in React Native for a TV App I'm developing. Basically I have a sidebar in my application, and when the user views content, they are ...
1
vote
2
answers
33
views
How can I set the focus to an invisible button or the window itself in a QDialog (PyQt5)?
I want to have a QDialog that blocks the interaction with the MainWindow, but where initially no widget has a focus, i. e. no button has a blue border and gets pushed when hitting "Enter".
I ...
0
votes
1
answer
44
views
Handling focus changes in tvOS SpriteKit app, where scene is embedded in a SwiftUI SpriteView
I'm having a mare trying to receive TV remote navigation (via the focus engine) in my SpriteKit game.
I've got a SwiftUI tvOS app with the following heirarchy:
struct SwatchGridSceneView: View {
...
0
votes
1
answer
20
views
Flutter TextField onTopOutside: can not refocus after unfocus
Scaffold(
appBar: AppBar(title: const Text('Example')),
body: SizedBox(
width: 100,
height: 40,
child: Builder(builder: (context) {
...
1
vote
0
answers
13
views
selectorprimaryfocus in ComboBox
I am trying to set focus to a comboBox which is present inside a Tearsheet when the tearsheet is opened. but it doesnt work.
import { ComboBox } from "@carbon/react";
import { Tearsheet } ...
1
vote
3
answers
58
views
Not possible to set focus on content of Tooltip component from Material UI on firing onClick event but possible on firing onKeyPress event
I am using Tooltip component from MUI in my customized TooltipComponent. TooltipComponent works similar to Dialog: user can see some content pop up after clicking (not hovering) on element (div with a ...
1
vote
1
answer
46
views
Focus isn't regained when swiping back from a Route, unlike using the back button in Flutter, iOS
Any ideas on why this is happening and possible solutions would be really welcome!
When I have assigned Focus to a Widget and I am navigating to a new route, and then navigating back to the previous ...
1
vote
1
answer
56
views
WPF TextBox select content on mouse click
For WPF TextBox I need to select all content of it in case of mouse click on it (in "real life" it will be touch on touchpad monitor).
For test I created simple project and check the ...
1
vote
2
answers
328
views
VS code isn't focused when I click on it on my Ubuntu machine
Whenever I click on vs code with my mouse, It focuses on the window behind or other apps. I am using Ubuntu 24.04. I don't know if this has any relation with it since it worked fine on older versions.
...
2
votes
0
answers
44
views
Why can't I type in on custom autocomplete popper with input
I can't write in the input label and year. In my application, I have a dropdown where I have an input for search and two inputs for add a film (title and year). The main problem is that the focus is ...
0
votes
1
answer
45
views
React js make background blur when input is focused
I want to create an input field like in the picture, if the input field becomes focused then I want to change the background to blur
image example
Do I have to use a certain library? I'm currently ...
0
votes
0
answers
49
views
Jetpack Compose: how to set initial a11y focus
I cannot figure out how to set the initial focus for Talkback for Compose elements... I am able to do it for keyboard focus just fine...
Here is an example where you click on the first thing with a ...
0
votes
0
answers
90
views
What happened to the Windows feature that prevented applications to steal the focus?
Some years ago, it was useless to use an API such as SetForegroundWindow to force some Window to the top of the Z-Order: the only result you got was a blinking icon in your taskbar, as stealing focus ...
0
votes
3
answers
72
views
Flutter TextField: how to lose focus on tap outside?
Flutter TextField: how to lose focus on tap outside?
TextField()
It loses focus only when tap another widget that can take focus such as TextField.
What if the TextField is the only one widget in the ...
1
vote
1
answer
111
views
Material UI custom colors
Goodmorning everybody,
I am trying to develop a website using ReactJS and Material UI.
I started from this template.
I would like to modify the color of the TextField when focused: now it is blue, let'...
0
votes
0
answers
40
views
Pi Virtual Keyboard doesn't focus in text box
On a PI 4 I have installed "Matchbox Keyboard" and "Onboard" but can get neither one to focus where I want to write text. I am trying to write something in a browser search bar so ...
0
votes
0
answers
37
views
Jetpack Compose: how to set focus color separate from ripple color
We use a dark ripple color for most of our controls, which gives us a dark grey ripple effect AND dark grey focused state.
But we also use a custom "border-style" focused state for controls. ...
1
vote
0
answers
28
views
In VSCode is there a way to focus on first editor in first group in one command without altering "last recently used editor"?
I want to focus on first editor in first group using a keybinding, then using another keybinding I want to switch the focus back onto the editor I was working on before. This previous editor might be ...
0
votes
2
answers
22
views
How to programmatically set focus to TextField built by fieldViewBuilder of an Autocomplete widget?
Tried to give input focus to a TextField by extracting the FocusNode from the AutoComplete's fieldViewBuilder function. For this i need a setState call inside the fieldViewBuilder function, which ...
1
vote
1
answer
170
views
How to shift focus and undo focus from one widget to other in flutter?
I've been new to flutter, and I am learning right now how this focus works?
So far from ai chats and stackoverflow [links][1] (one of the best links I found) I have come to know about `focusnode` but ...
1
vote
0
answers
111
views
Android Compose (TV) wrong focus when TTS is on
Using jetpack compose to create an APP for TV platforms and I've been trying to create a Vertical List of Horizontal Lists using a LazyColum/LazyRow having a enter Focus (first item Top Left), when ...
1
vote
1
answer
47
views
Image viewer with thumbnail Arrow Keys and Click - not able to focus again on click
I have a fairly simple image viewer that puts small images (thumbnails) into a div and allows the user to left and right arrow through the thumbnails and see the larger image below. It also focuses ...
0
votes
0
answers
42
views
useEffect Not Properly Handling Focus on iOS Devices in React Application
I'm working on a React application where we use a custom hook (useFlipAnimation) to manage the flipping animation of a card component. When the card flips to its back side, we want to automatically ...
0
votes
1
answer
54
views
tabindex for divs with landmark roles, right or wrong?
I have had feedback from an accessibility expert that it is irritating for screenreader users that I use tab indexes on my landmark regions. I added the tab-index so that users can use skiplinks to ...
1
vote
1
answer
75
views
What am I doing wrong when trying to manually focus an input with Angular and PrimeNg?
I am using Angular with PrimeNg. I have a Google Forms-like app and in a part of the app I have a set of options, each having a radioButton. I can have the 'Other' option where the user can manually ...
1
vote
0
answers
44
views
JavaScript Focus Ring Option Is Not Working
I'm using the code below to set focus to a button and have a focus ring displayed around the button. While the button does indeed get focus (which I can tell because if I press the space bar the ...
0
votes
0
answers
9
views
Prevent checking checkbox input in contentEditable from stealing focus from editor in Android webview?
Unfortunately event.preventDefault inside of mousedown doesn't do the trick. I tried the same inside of pointerdown (no luck) and touchstart (it says the event is not cancellable)
I can't insert any ...