#7458 closed bug (invalid)
slow click event handle?
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | |
Component: | unfiled | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
i have modal div with table on it. Clicks on tr removes them (it cant resize automaticly by css, so i have $.modalUpdate() function to resize modal window), and $.modalRemove() binded to modal outside clicks.
$(document).bind('click.modalOutsideClick', function(e){ if($(e.target).closest('.modal').attr('class') != 'modal') $.modalRemove(); }); $('tr').live('click',function(){ $('tr').remove(); $.modalUpdate(); }
so, when tr.click event fires, $.modalRemove() fires too. only if tr.remove runs after delay - it will work normal.
$('tr').live('click',function(){ setTimeout(function() { $('tr').remove(); $.modalUpdate(); }, 100); }
Change History (7)
comment:1 follow-up: 2 Changed 12 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
Status: | pending → new |
---|
Replying to SlexAxton:
Can you reduce this and post a test case at jsFiddle.com? That would greatly help us narrow down the issue for you. Thanks.
comment:3 Changed 12 years ago by
Milestone: | 1.5 |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Commenting out "$('.opaque, .modal').remove();" in $.modalRemove() function corrects this issue.
http://jsfiddle.net/rwaldron/BtWBA/7/
The forums are a better place to ask about these things, you'll get faster and more detailed replies there. Be Excellent to youself!
comment:4 Changed 12 years ago by
You do not quite understand me correctly. Function $.modalRemove() is triggered when it should not do that. Event click.modalOutsideClick must run a function $.modalRemove() when the event target is not .modal child. Please read the example carefully. Click on .modal child must remove this child and do nothing. But it also fires $.modalRemove().
comment:5 Changed 12 years ago by
Actually, I understand this very well. It's still not a jQuery bug. You have issues with your event binding and delegation.
Take a look around here: "click.modalOutsideClick".
comment:6 Changed 12 years ago by
I'm very sorry only now found out about event bubbling sorry for any inconvenience
comment:7 Changed 12 years ago by
It's no problem! Glad we could facilitate a learning experience :D
Can you reduce this and post a test case at jsFiddle.com? That would greatly help us narrow down the issue for you. Thanks.