?
Solved

input text box not behaving properly when debug points are set

Posted on 2016-10-25
4
Medium Priority
?
97 Views
Last Modified: 2016-11-30
HI,
There is the following input html :
<input type="text" class="flock-js-input" value="..." placeholder="Search.." autocomplete="off">

And the following listener on it :
$('.flock-js-input').keydown(function(e){
    if(false) {

     }
});

$('.flock-js-input').keyup(function(e) {
     
});
The false is just the case i am testing and is not the actual values there...
Now when user types in something in input textbox and keydown listener invokes
But there are following issues :
1) keyup listener does not invoke
2) The textbox does not get filled with the key typed

This happens only when i have put debug points in firebug inside keydown listener.
When debug points are not set... things work perfectly fine... the keyup listener also gets invoked and textbox also gets filled with the keys pressed
What could be the reason for this.

Thanks
0
Comment
Question by:Rohit Bajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 41860062
There is nothing wrong with the code as you have posted. Consider this
<script>
$(function() {
  $('.flock-js-input').keydown(function(e){
    console.log('keydown');
    if(false) {
    }
  });

  $('.flock-js-input').keyup(function(e) {
    console.log('keyup');
  });
});
</script>

Open in new window

Working sample here - F12 to view the console when you do a key press in the <input> both events fire.

Without seeing all your code (if you have stripped code out) we can't diagnose.
0
 

Author Comment

by:Rohit Bajaj
ID: 41868547
Hi,
In the same code that you pasted... if i put debug point on both the console statements then only the keydown event is fired and keyup is not also the textbox does not get filled up with the text.
I put the debug points in my firebug on your page
0
 
LVL 58

Assisted Solution

by:Julian Hansen
Julian Hansen earned 2000 total points
ID: 41868657
That is a function of the debugger - not the code. The code works but if the debugger is not caching the events for you to continue to debug with then that is an issue with the debugger.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question