Questions tagged [onblur]

The blur event fires when an element loses focus.

The blur event fires when an element loses focus.

653 questions
6
votes
3 answers

Trying to use v-on:blur for making disappear a context menu...but it doesn't work

I am coding a simple context menu in vue.js. When I do a right click on a peculiar element, it opens the menu (using @contextmenu.prevent).This works. But when I click outside of the menu I want it to disappear. This doesn't work... I am using…
Bénédicte Lagouge
  • 482
  • 2
  • 9
  • 24
6
votes
3 answers

React js input invalid while user types (I want to validate onBlur instead of onChange)

I've run into this problem a few times, and I'm looking for the "react way" to solve this. The Problem A number field is temporarily invalid while the user is typing. For example: "-45" is "-" and "2.3" is "2.". The simplest validation example is…
scms
  • 93
  • 1
  • 6
6
votes
3 answers

button click event lost due to the alert box in text box onblur event

I have created a simple web form, containing one text box and one button. I have captured the onblur event of the text box. Untitled Page
Vinod T. Patil
  • 2,951
  • 3
  • 26
  • 21
6
votes
2 answers

Struggling to add a blur event listener

I have a searchbox on the site I work on and would like to track the search terms folk are looking for. Since the searchbox auto guesses what someone is typing and searches for it, there is no click event. In the console the textContent that I want…
Doug Fir
  • 19,971
  • 47
  • 169
  • 299
6
votes
4 answers

How to use Firebug when debugging Javascript entailing focus/blur event handling

I'm trying to use Firebug to debug some Javascript that entails blur and focus event handling, specifically some auto-complete/look-ahead functionality. The issue is that, merely by clicking on the various tabs within Firebug, such as "Console",…
Dexygen
  • 12,287
  • 13
  • 80
  • 147
6
votes
4 answers

Event bubbling and the onblur event

I'm writing a form validation script and would like to validate a given field when its onblur event fires. I would also like to use event bubbling so i don't have to attach an onblur event to each individual form field. Unfortunately, the onblur…
Stephen Sorensen
  • 11,455
  • 13
  • 33
  • 46
6
votes
3 answers

select onchange same value

Is there a way to trigger an event if I open a dropdown select, and select the same value WITHOUT clicking away to switch focus? I tried onblur, but it only works if I make an extra click outside the select. onchange, but it only works if I select…
Uno Mein Ame
  • 1,060
  • 5
  • 16
  • 29
6
votes
6 answers

Blur Event Does not get Fired in IE7 and IE6

I have a dropdown Menu where in a div is clicked and List is shown. On focus out I am supposed to hide the list(i.e. when the user clicks or focuses on some other element and not on mouse out). Hence my obvious choice was onblur. Now the JavaScript…
yeshvanthni
5
votes
2 answers

JavaScript OnBlur event prevents HTML form from being submitted

Consider the following form:
When focus is on element with…
Artem
  • 7,275
  • 15
  • 57
  • 97
5
votes
2 answers

React-Native: 'onBlur' is not getting fired when touched out side of the TextInput

this.mobileNumberRef = ref} keyboardType='phone-pad' returnKeyType='done' onBlur={() => Keyboard.dismiss()} /> I would like to dismiss the keyboard when touched outside of the TextInput…
ThinkAndCode
  • 1,319
  • 3
  • 29
  • 60
5
votes
4 answers

Hiding the suggestion list of an autocomplete AJAX control on blur

I am implementing an AJAX "autosuggest" box: the user types a string in an input text field, a hidden div with a table is shown, and then he/she can click on a row or scroll the list with the up/down arrows; in the meantime, the focus is still kept…
5
votes
6 answers

Angular 7 | HostListener blur conditional stop all other event callbacks

I have one requirement where We want the user to resolve input field errors and until that is done user is not allowed to do any other operation on-screen. For the same, I have implemented HostListener on the input field and onBlur I am setting the…
Manish Kumar
  • 1,131
  • 15
  • 28
5
votes
3 answers

ReactJS: Save input value on blur and not on every key stroke

I have created a React View, say MyView, which has 2 text inputs whose initial values will be passed by parent read from a DB. I also want the changed values to be saved back to DB. So, the view is also passed a callback function for the…
5
votes
1 answer

onBlur resets value in react-select

I have problem with react-select. When I type some text in searchable input and click outside, my text is disappear. I tried onBlur={() => input.onBlur({value: input.value})} and it works fine but I have ugly errors in console. Something like…
Michal
  • 77
  • 1
  • 3
  • 7
5
votes
2 answers

Make a search menu disappear when the search field loses focus, but still allow user to click on links

On my website I have a search box (text input field). When the user clicks on it and starts typing text a menu of links appears. The menu appears via JQuery - The following command makes the menu appear: ".focus(function() { …
big_smile
  • 1,487
  • 4
  • 26
  • 59