Solved

input text box not behaving properly when debug points are set

Posted on 2016-10-25
4
84 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 57

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 57

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

SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

Question has a verified solution.

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

Suggested Solutions

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

732 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