Search and Top Navigation
#5960 closed bug (duplicate)
Opened August 16, 2010 08:47PM UTC
Closed November 21, 2011 04:44PM UTC
Last modified October 11, 2012 09:15PM UTC
[RFC] Problem with fast clicking on large button
Reported by: | juliobiason | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.button | Version: | 1.8.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
We have a large buttonset (around 36 elements) and we found that, sometimes, when we click really fast (i.e. toggle the status of some closer elements), the button would get a ui-state-active class, but neither its aria or checked would change. This could be checked in Firefox 3.6.x and 4.0b3.
I had the impression that, when we did that, the event being currently dealt with got interrupted and the new event would take control. So the class would change, but not the status of the checkbox behind it (Note: I'm talking this out of my ass, I don't have enough knowledge about the internals of Firefox).
The solution I found was to force everything to happen in a single pass, basically "blocking" any other actions till everything could be changed at once (again, out of my ass.)™
The changed code: (in jquery-ui-1.8.4.custom.js, around line 5384):
if ( options.disabled ) { return false; } // inverted controls if(self.element[0].checked) { $(this).removeClass('ui-state-active'); self.buttonElement.attr('aria-pressed', false); self.element[0].checked = false; return false; } else { $(this).addClass('ui-state-active'); self.buttonElement.attr('aria-pressed', true); self.element[0].checked = true; return false; }
It worked for us, but I'm not sure if this solves another problem (#5518 comes to my mind, after reading their report) or actually causes more problems.
Is this code safe?
Attachments (0)
Change History (5)
Changed August 16, 2010 08:47PM UTC by comment:1
Changed January 11, 2011 08:49AM UTC by comment:2
_comment0: | Will this ever get fixed ? if I click rapidly on a button, it skips the click event just like he says but with every single button. Very annoying. Can't believe this has 5 months. \ \ By the way, that workaround isn't working for me. → 1294744326035757 |
---|
Will this ever get fixed ? if I click rapidly on a button, it skips the click event just like he says but with every single button. Very annoying. Can't believe this has 5 months.
By the way, that workaround isn't working for me.
[EDIT]
Ok, now it works, although there is a mistake, it should be:
if(!self.element[0].checked) {
$( this ).removeClass( "ui-state-active" );
self.buttonElement.attr( "aria-pressed", false );
self.element[0].checked = false;
} else {
$( this ).addClass( "ui-state-active" );
self.buttonElement.attr('aria-pressed', true);
self.element[0].checked = true;
}
its not the best but at least you won't have an active button without the active button effect.
Changed November 21, 2011 04:44PM UTC by comment:3
resolution: | → duplicate |
---|---|
status: | new → closed |
Changed October 11, 2012 09:15PM UTC by comment:5
milestone: | TBD |
---|
Milestone TBD deleted
Btw, if anyone wants to check the running code, we have it at:
http://iplenix.com/ms/demo/iplenix/reports.tpl