Opened 15 years ago
Closed 15 years ago
#3077 closed bug (invalid)
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.
Change History (2)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
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.
Note: See
TracTickets for help on using
tickets.
and I can't believe I selected 1.2.5 instead of 1.2.6 ...