Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7524733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:08:39+00:00 2026-05-30T03:08:39+00:00

It appears that the Blur event stops the click event handler from working? I

  • 0

It appears that the Blur event stops the click event handler from working? I have a combo box where the options only appear when the text field has focus. Choosing an option link should cause an event to occur.

I have a fiddle example here: http://jsfiddle.net/uXq5p/6/

To reproduce:

  1. Select the text box
  2. Links appear
  3. Click a link
  4. The blur even occurs and the links disappear
  5. Nothing else happens.

Expected behavior:

On step 5, after blur occurs, the click even should also then fire. How do I make that happen?

UPDATE:

After playing with this for a while, it seems that someone has gone to great lengths to prevent an already-occurred click event from being handled if a blur event makes the clicked element Un-clickable.

For example:

$('#ShippingGroupListWrapper').css('left','-20px');

works just fine, but

$('#ShippingGroupListWrapper').css('left','-2000px');

prevents the click event.

This appears to be a bug in Firefox, since making an element un-clickable should prevent future clicks, but not cancel ones that have already occurred when it could be clicked.

Other things that prevent the click event from processing:

$('#ShippingGroupListWrapper').css('z-index','-20');
$('#ShippingGroupListWrapper').css('display','none');
$('#ShippingGroupListWrapper').css('visibility','hidden');
$('#ShippingGroupListWrapper').css('opacity','.5');

I’ve found a few other questions on this site that are having similar problems. There seem to be two solutions floating around:

  1. Use a delay. This is bad because it creates a race condition between the hiding and the click event handler. Its also sloppy.

  2. Use the mousedown event. But this isn’t a great solution either since click is the correct event for a link. The behavior of mousedown is counter-intuitive from a UX perspective, particularly since you can’t cancel the click by moving the mouse off the element before releasing the button.

I can think of a few more.

3.Use mouseover and mouseout on the link to enable/disable the blur event for the field. This doesn’t work with keyboard tabing since the mouse is not involved.

4.The best solution would be something like:

$('#ShippingGroup').blur(function()
{
   if($(document.activeElement) == $('.ShippingGroupLinkList'))
      return; // The element that now has focus is a link, do nothing
   $('#ShippingGroupListWrapper').css('display','none'); // hide it.
}

Unfortunately, $(document.activeElement) seems to always return the body element, not the one that was clicked. But maybe if there was a reliable way to know either 1. which element now has focus or two, which element caused the blur (not which element is blurring) from within the blur handler. Also, is there any other event (besides mousedown) that fires before blur?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:08:40+00:00Added an answer on May 30, 2026 at 3:08 am

    click event triggers after the blur so the link gets hidden. Instead of click use mousedown it will work.

    $('.ShippingGroupLinkList').live("mousedown", function(e) {
        alert('You wont see me if your cursor was in the text box');
    });
    

    Other alternative is to have some delay before you hide the links on blur event. Its upto you which approach to go for.

    Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

it appears that the Apple site now only provides download for Xcode 3.2, that
It appears that we will have to build/deploy one of our new JBoss apps
I have a text box input in a form; when I click it, a
I have an input box that as you type displays a div called suggestions
I have an email sign up and search box that have the label inside
It appears that to use Google Translate you have to use an API key
It appears that in C# 4.0, variance specifiers are only applicable to interface types.
It appears that my song file that I am trying to grab from the
I am working on a Cocos2d iPad game that includes a magical book. From
I have a page where you can click a link that says add a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.