Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

SelectMultiple returns incorrect value in afterChange when numberOfCheckedBoxes == 0

#47

When numberofCheckedBoxes == 0, the value passed to afterChange is still the value of the last checked box, rather than empty, since no boxes are checked.

Patched function:


checkboxOnClick: function(checkbox){
	this.numberOfCheckedBoxes += (checkbox.checked) ? 1 : -1;
	this.scanCheckBoxes();
	this.notify('afterChange',this.numberOfCheckedBoxes == 0 ? "" : this.select.options[this.select.options.selectedIndex].value);
},

Reported by JamLegend · February 24th, 2009 @ 06:29 PM

State: resolved
Milestone: 1.0
Assigned to: Ryan Johnson Ryan Johnson

Activity

  1. Nathan L Smith
    Nathan L Smith
    • State changed from unconfirmed to confirmed

    May 19th, 2009 @ 08:18 PM

  2. Nathan L Smith
    Nathan L Smith
    • State changed from confirmed to resolved

    This method had another problem, as setting the value of a checkbox programtically (c.checked = true), will not fire a click event and (in|de)crement the value.

    numberOfCheckedBoxes now uses findAll to find the actual number of boxes checked and notifies with an empty string if none are checked.

    May 24th, 2009 @ 11:28 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.