Questions tagged [lost-focus]

The transition that occurs when a control status changes from focused to unfocused.

The transition that occurs when a control status changes from focused to unfocused.

182 questions
78
votes
1 answer

blur event.relatedTarget returns null

I have an field and I need to clear it when this field loses focus (whiech means that user clicked somewhere on the page). But there is one exception. Input text field should't be cleared when user clicks on a specific element. I…
CMTV
  • 2,531
  • 2
  • 17
  • 25
55
votes
4 answers

How to force to lose focus of all fields in a form in jQuery

When a input field changes (onchange) I trigger a function to set a variable. The only problem is that the field first has to lose focus before the variable is set and I can check if the field(s) is changed, this is what I want to do when the user…
Jilco Tigchelaar
  • 2,065
  • 8
  • 31
  • 51
17
votes
0 answers

Android keyboard focus losts while going to another view by DPAD

We have 17 api, DPAD control and 4 edittexts in one layout for pin enter. When user try to open something which is locked in the app he faced with fragment where he should enter 4 digits pin. When view is opened we set programmatically view focus to…
15
votes
3 answers

Having TextChanged Event Fire Immediately as Text is Typed into TextBox

On a wpf TextBox that has an TextChanged event, it seems to only fires when focus is taken away from the textbox; but not as individual characters are typed in. Is there an event similar to TextChanged that fires immediately when a character is…
thecoop
  • 45,220
  • 19
  • 132
  • 189
14
votes
4 answers

TextBox LostFocus is not raised when clicking on certain other controls

In the following simple WPF application a TextBox is set to update a property when the focus is lost from that control, like so
Justin
  • 84,773
  • 49
  • 224
  • 367
13
votes
4 answers

Is it possible to write onFocus/lostFocus handler for a DIV using JS or jQuery?

I have a div and when the user clicks the div a function should be called. And when the user clicks something else (anything other than this div) another function should be called. So basically i need to have onFocus() and lostFocus() function calls…
Ivin
  • 4,435
  • 8
  • 46
  • 65
12
votes
6 answers

How do you solve this LostFocus/LostKeyboardFocus issue?

Ok, I have a control that has an IsEditing property which for argument's sake has a default template that is normally a text block, but when IsEditing is true, it swaps in a textbox for in-place editing. Now when the control loses focus, if it's…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
10
votes
2 answers

Why does the LostFocus event get called at different times?

In reference to this MSDN page (or any related page on the matter), it states that: When you change the focus by using the keyboard, focus events occur in the following order: Enter GotFocus Leave Validating Validated LostFocus However, when…
Kyle Baran
  • 1,793
  • 2
  • 15
  • 30
10
votes
3 answers

Slickgrid - Lost focus to end edit

When editing my grid, if I click outside the grid, the box I was editing is still editable. How do I get the edited cell to "complete" the edit when it looses focus?
sunzyflower
  • 195
  • 3
  • 13
9
votes
1 answer

Lost input focus on hooks function state change

When i define the hooks state in the parent function i lost input field focus on first key press. I need the state definition in the root function. import React, { useState } from 'react' function Test1(props) { const [test, setTest] =…
Unsal
  • 121
  • 1
  • 6
8
votes
2 answers

How do I find out where the focus is going in my WPF application?

I have a search screen in my WPF application. The screen is implemented as a UserControl in a TabItem of a TabControl. When the user switches to the Search tab, I want the focus to go into one particular field. So I added a Loaded event handler to…
Tony Vitabile
  • 8,298
  • 15
  • 67
  • 123
8
votes
1 answer

Did user use keyboard or mouse to leave WPF TextBox?

I have a handler for the TextBox's PreviewLostKeyboardFocus event. It fires when I leave the TextBox using the keyboard (Tab key) or the mouse (by clicking on another TextBox on the form). The handler takes a KeyboardFocusChangedEventArgs, which…
lance
  • 16,092
  • 19
  • 77
  • 136
8
votes
3 answers

WPF TextBox MenuItem lose focus when moving mouse

In my WPF application I want a menu item to have a text box. I have managed to do this using the following code:
dbostream
  • 781
  • 2
  • 11
  • 27
6
votes
2 answers

How to fire "focusout" event when focus lost of input placed in table?

I have a table where inputis placed:
StepUp
  • 36,391
  • 15
  • 88
  • 148
5
votes
5 answers

How to trigger ASP.NET client-side validations without submit?

I have a website in ASP.NET (WebForms, NOT MVC) which has a survey form divided in several slides. Each slide has a next button that, obviously does a transition (client-side, not post back or remote request) to the next slide. In each slide I have…
empz
  • 11,509
  • 16
  • 65
  • 106
1
2 3
12 13