Solved

input text box not behaving properly when debug points are set

Posted on 2016-10-25
4
75 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
  • 2
4 Comments
 
LVL 55

Accepted Solution

by:
Julian Hansen earned 500 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 55

Assisted Solution

by:Julian Hansen
Julian Hansen earned 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery tab header text 1 22
Output to HTML in powershell 3 25
JQuery Syntax... 4 32
Copying table data to one another 15 29
Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

839 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