Side navigation
#3077 closed bug (invalid)
Opened June 23, 2008 07:26PM UTC
Closed June 24, 2008 07:24PM UTC
Toggle on checkboxes
Reported by: | ThrushAAX | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | event | Version: | 1.2.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Unexpectedly when a checkbox has a .toggle() bound to it the state will not change after its callback function is completed. The state will change within the callback function but it will not be saved.
Example Code:
$("input").toggle(function(){ console.log("A",this,this.checked) }, function() { console.log("B",this,this.checked) });
Output:
A <input type="checkbox"> true B <input type="checkbox"> true
If this is intentional it should probably be documented.
Attachments (0)
Change History (2)
Changed June 23, 2008 07:30PM UTC by comment:1
Changed June 24, 2008 07:24PM UTC by comment:2
component: | core → event |
---|---|
milestone: | 1.2.5 → 1.3 |
resolution: | → invalid |
status: | new → closed |
version: | 1.2.5 → 1.2.6 |
Because toggle() calls e.preventDefault() which prevents the click from executing.
Use the events mouseenter and mouseleave instead.
and I can't believe I selected 1.2.5 instead of 1.2.6 ...