Questions tagged [focus]
Focus indicates the component of the graphical user interface which is currently selected to receive input.
7,029
questions
3
votes
2
answers
41
views
SolidJS: input field loses focus when typing
I have a newbie question on SolidJS. I have an array with objects, like a to-do list. I render this as a list with input fields to edit one of the properties in these objects. When typing in one of ...
-1
votes
0
answers
13
views
python - moving focus to another window
been programming on Access VBA, and now trying Python.
In VBA one uses forms(windows) to execute tasks: open a new window and close the previous-main window.
On Python, from the main Window (mainloop),...
0
votes
0
answers
6
views
How to trap focus inside the calendar when press shift+tab in calendar angular
When click shift+tab the calendar is not looping inside the calendar. I need Trap focus inside the calendar when press shift+tab in calendar angular. How to do that.
0
votes
1
answer
17
views
How to not lose selection with focus change?
From How to input without change focus , input without change focus is impossible, but maybe I can build an input that do not take focus(not like normal input), but I found focus on select will not ...
0
votes
0
answers
19
views
Flutter - TextField is active after coming back to its screen
Widgets of the screen with onTap/onPressed (also Drawer) don't trigger GestureDetector which wraps the Scaffold. Function removes focus if I tap on any other widget/blank space. Keyboard disappears ...
0
votes
0
answers
28
views
How to make fixed header availabel at the focus an focusable element?
I have a fixed header, when user scroll to an offset 100px, a class add to header to make it fixed:
fixed-header {
position: fixed:
top: 0,
left: 0,
right: 0,
width: 100%;
}
$( ...
-3
votes
0
answers
50
views
Is there a simple way to steal focus from all other programs with c++? [closed]
I have a console program that I'm supposed to use while using other programs, but it keeps dissappearing behind the other windows. I need a way to take back focus to the console window when it is done ...
0
votes
0
answers
15
views
Prevent background items from receiving focus while using MUI backdrop
We're dimming the screen when a (custom, not MUI) dialog is open using MUI backdrop but the "grayed-out" items are still active and the user can access them using the keyboard.
In the below ...
0
votes
0
answers
17
views
How can i transfer focus to the next focusable element inside an onFocus handler of another element?
I have a react app, and i am trying to build a focus trapper element, that lets the user tab through elements normally but won't let you focus outside their container.
What works
I am doing so by ...
0
votes
0
answers
4
views
Why is focus-visible applied on page load
If I understand correctly, focus-visible is only applied to an element if it is focused because of a keyboard interaction. However, in the following example, if I programmatically focus the element on ...
0
votes
0
answers
11
views
can't set initialFocus on focus-trap in vue component
I am using the focus-trap package for Vue3 to trap focus inside a form, inside of a modal. I'm having trouble with the :setInitialFocus prop, I think because the element I'm trying to reference there ...
0
votes
0
answers
23
views
scroll to a overflowing item inside flex box
My desired goal is that when I keyboard to the right outside of the flexbox, I want to push the other items to the left so I can see the terms in the overflow, like a scroll. I can currently keyboard ...
2
votes
1
answer
42
views
Probem with the focus function in Angular
I hope you can help me, I just started as a programmer and I have a newbie problem,
I have two inputs, I want to write a series of numbers in my first input (DO) and then automatically pass to the ...
1
vote
1
answer
15
views
Cannot make input:focus overwrite default setting
I am trying to make a CSS style for a form using a border-bottom style that goes to a green box. However I see that the input:focus syntax does not work, and it shows the default focus style. Can ...
1
vote
1
answer
46
views
SwiftUI Focus State API environment variable not working
Environment value isFocused doesn't seem to work when we want to observe focus state of SwiftUI textfield. Is there any other way to do this, besides passing the value to TextFieldStyle's init (which ...
0
votes
1
answer
32
views
.focus() not working, browser keeps focusing the body
I am currently working on the accessibility for the React modules at our company.
Although I am just a hobby webdev I would still really like to solve this.
What's going on is:
We have a module with 6 ...
0
votes
0
answers
19
views
Set focus for python turtle textinput
In my python project (game) I have a function to get player (2) names:
def get_names(self):
self.lp_name = turtle.textinput("Left Player", "Enter your Name")
self.rp_name = ...
0
votes
1
answer
30
views
Tab-focused button border color and style
I have this button in my User Control:
<Button
x:Name="OkButton"
Grid.Column="1"
Command="{Binding Confirm}"
IsDefault="True"
IsEnabled=&...
2
votes
1
answer
16
views
How to programmatically focus a button in React?
Autofocus does not work for me because I need it (button2) to focus when button1 gets clicked, not when the element loads. This is what my code looks like:
const MyComponent = props =>{
return(...
0
votes
0
answers
11
views
Preventing losing focus when showing an element with jquery show
I'll try the best to be as mutch clear as possible.
I've an element with a click handler attached via jquery, let's call this element "e1". When "e1" is clicked, the handler call a ...
1
vote
0
answers
23
views
How to put text using JButtons in the JTextField which has focus? [duplicate]
I've made two JTextField controls named textfield1 and textfield2 in Java. I've also made a number pad using JButton components and added an ActionListener to each of them. Now I want the ...
0
votes
1
answer
14
views
Button retains focus when mousedown and mouseout, accesibility implications
It seems to be a consistent browser behaviour that when the user drags out of a a element, to avoiding clicking on releasing the mouse button, that that element retains focus until the user clicks ...
-1
votes
0
answers
22
views
OnKeyDown event triggers onClick event on another button
I am implementing the list with items and details page(opened on item click)
A user can make it either by mouse click or keyboard navigation. When the user opens details by keyboard navigation the ...
1
vote
0
answers
17
views
How to prevent focus going to whole ListViewItem when the item's content view is clicked
I have created a Xamarin ListView sample with customized item template.
When I clicked the content view in the item template focus is applied for the list view item instead of that content view in ...
0
votes
0
answers
18
views
How to remove focus on Input in React in Chrome
Current Behavior & Problem
https://im5.ezgif.com/tmp/ezgif-5-b663b3af7e.gif
I'm doing an OTP function where the user needs to add a number inside an input, but in google chrome always they Click ...
0
votes
0
answers
57
views
Traversing focus on right and left arrow keys
First press the tab key, the first link will be highlighted then press the right arrow keys to see the focus jumping to next level navigation traversing ahead, similar way once I click the left arrow ...
-2
votes
0
answers
24
views
Angular how to set focus on a FormControl of FormGroup of the FormArray?
I have a reactive form that contains a table where one row is a FormGroup so the table rows in a FormArray. Each row is a FormGroup (represent a Form) that has two fields (text and numeric input) When ...
0
votes
0
answers
13
views
Android Talkback focus whole view in scrollview
I have a scrollView with a LinearLayout with a vertical orientation and 10 views inside it. When talkback is activated and the focus is going from one element down the other sometimes the focus is not ...
-2
votes
0
answers
19
views
How do I move a modal popup focus?
I am a student who has been learning Vue.js for a week.
After creating several buttons that display a modal popup, if you press a random button to open a modal popup, how can I get the focus to the ...
-1
votes
0
answers
24
views
How does one make NSScrollView respond to keyboard when NSTextFields are adjacent to it?
I have a simple interface in a NSView in a window for a MacOS desktop application written in Swift.
Along with a bunch of other buttons and labels, the interface has two (sub-classed) NSTextFields as ...
0
votes
0
answers
7
views
How to stop the zoom animation from repeating because of the spam of LayoutManager.findFirstCompletelyVisibleItemPosition();
Using LayoutManager.findFirstCompletelyVisibleItemPosition(); I’m trying to zoom-in when the element is fully visible and zoom-out when it becomes partially/completely invisible. Scrolling over an ...
0
votes
2
answers
43
views
Weird double click behavior with text highlighting, when dynamically changing the contentedible attribute of a div
The requirements:
We need an editable div that only becomes editable after a user clicks on it
The div goes back to being read-only when focus is taken away from the div
The issue:
I can achieve ...
1
vote
1
answer
26
views
How can I move my caret on the other JTextField
I have this code that create some text fields and I want that my caret changes his position to the other JTextField after pressing ENTER. Is it possible to do this? In the picture, I gave an example ...
0
votes
0
answers
43
views
Android - focus an input textfield inside a webview
I have a problem to focus an input textfield inside a webview. In the webview a text input field is shown. If you click inside, the keyboard opens and the navigationbar is shown as required. The ...
1
vote
2
answers
58
views
When An Input Element Has Focus In A Specific Context, Fire An Event On Use Of the Enter/Return Key - JavaScript
I have a form that has multiple image components inside it that are outputted onto the page with a while loop. When the form is submitted after the image details have been added they are uploaded to a ...
0
votes
0
answers
36
views
Enter key and tab not working for focus class
I am trying to tab the buttons for accessibility reasons in the header however I am not able to tab over them.
I have the following css
.nmcnav_clickable:focus {
background-color: yellow;
}
....
0
votes
0
answers
24
views
How To Use 'beforeunload' to Capture Iframe Click?
I am trying to build a code that does a request when a cross-origin iframe is clicked and it directs the main window to a new page.
Since it's impossible to directly tap into Iframe click events, I ...
0
votes
1
answer
34
views
How to get inactivity timer to work in tkniter when tkinter window is not active?
I'm having trouble getting a timer (loop or anything) running when the tkinter window is withdrawn or not on top of other windows. The functionality of this is like a small screen saver, start the ...
1
vote
1
answer
38
views
Focus ON/OFF in GUI.TextField
initially I thought I wouldn't have to post such a post,
because the topic seems quite simple. As you can see, he has surpassed me.
I have two logistical problems with the following code.
This is the ...
0
votes
1
answer
54
views
How shift Request Focus to next textfield in Jetpack compose
My requirement is when I enter 1 digit in text field after entering it should be shifted to next text field. Everywhere I got the answer like this.
In short I'm looking for similar functionality like ...
2
votes
3
answers
61
views
How to toggle the focus of an input using only JavaScript?
I have been trying to make this thing that focuses an input inside it when its outer div is clicked. I really hope this is not a duplicate as I have searched everywhere and not found an answer to this....
0
votes
0
answers
36
views
MacOs SwiftUi Strange behavior when focusing on TextField
How can you see in the image this happens?
Can you tell me the reason?
@State var accountName = ""
HStack {
Text("Account:")
TextField("Enter your username&...
0
votes
2
answers
46
views
How to set the focus to an image or a label ?[Java Swing]
Let's say I have several images, each of them in a label, is there a way to set the focus on one of the images or JLabels by clicking at it and do some image processing on the clicked image (blur, ...
0
votes
2
answers
23
views
Prevent parent element's content movement when a transitioning child is focused
Let's say I have a container which contains two divs:
the first div is just a text container, no special style applied
the second div is a slider which should slide in from the side of the container ...
0
votes
1
answer
32
views
How do you change the stacking order of window items in a canvas?
I am trying to make a windows 10 simulation in a canvas of a Tkinter window (ambitious I know) and obviously I need a way to focus the simulated windows (which are ironically canvas window items) when ...
0
votes
1
answer
35
views
Mark a cell in my datagrid when the program starts
I can easily programmatically mark a cell in my datagrid using the following code:
DataGrid1.ScrollIntoView(DataGrid1.Items[Rowindex]);
DataGrid1.Focus(); ...
0
votes
0
answers
11
views
How to set focus to a cell in Pyqt5 Table Widget [duplicate]
I'm using pyqt5, Table Widget, and Python. Everything is working fine with my code, but I can't figure out how to set focus to a particular cell (or any cell). If my table looks like the below table, ...
1
vote
1
answer
79
views
How to fix focus problem on SVG image with CSS
I have Svg image, that is the outer layer, and inside I have other divs and then text which I have fixed with positioning. My hover and other effects works fine, but when I try to add focus,then it ...
0
votes
1
answer
36
views
Move tab from form control to popup and from popup to form
I have a popup opening next to the textbox. When I click on the tab key from the textbox it should be navigated to the close icon of the popup (top right corner) and when I click on the close button ...
0
votes
2
answers
92
views
Send keys to active element in Selenium Python
So I have following element that I need to send keys to:
<input type="text" placeholder="Recipient address" class="text-gray-light py-1.5 sm:py-2 px-2 sm:px-3 bg-gray-dark ...