Bug Tracker

Modify

Ticket #1360 (closed bug)

Opened 6 years ago

Last modified 3 years ago

.change() on checkbox in IE

Reported by: stickmus Owned by:
Priority: major Milestone: 1.2.4
Component: event Version: 1.1.3
Keywords: Cc:
Blocking: Blocked by:

Description

Using change() on a checkbox in IE has some odd trigger issues.

The event fires after you click off the box.

As a workaround use the click() function

Attachments

1360.diff Download (1.2 KB) - added by brandon 6 years ago.

Change History

comment:1 Changed 6 years ago by john

  • need changed from Review to Test Case
  • Priority changed from trivial to major

This is the case with most IE form elements. I'd suspect that if we integrated a change like this, then we should do it for more input types as well (including radios and select boxes).

Changed 6 years ago by brandon

comment:2 Changed 6 years ago by brandon

  • Milestone changed from 1.1.4 to 1.2.2

The attached patch (1360.diff) uses the new special events api to make the change event into a click event for checkboxes in IE and a focus event for radios in IE and Safari. This seems to work okay except that it will fire the change event on radios when focused even if a change in value didn't occur. However, this is better than nothing.

comment:3 Changed 6 years ago by joern

What about the lack of a change event when changing a text input using the browser's autocomplete feature? Having that fixed, too, would make the change event actually useful.

comment:4 Changed 5 years ago by flesler

  • Milestone changed from 1.2.2 to 1.2.4

comment:5 Changed 5 years ago by Andrew

One odd thing is that there are inconsistencies between a simple <SELECT> and <SELECT multiple='multiple'>, and between browsers. All tests are on XP, jQuery 1.2.6.

On the tests below, the simple <SELECT> can of course have two display states, toggled by the user: I'm using "expanded" to mean it's expanded from the drop-down (several options visible, scrollbar displayed), and "unexpanded" to mean it's displayed as a single line. The keyboard up/down keys are being used to change the SELECT value.

The Change event does gets fired in the following circumstances:

  • <SELECT multiple='multiple'> on Firefox 3, IE7, (Opera 9.5*)
  • <SELECT> unexpanded on Opera 9.5, IE7

but the Change event does not get fired on:

  • <SELECT> unexpanded on Firefox 3
  • <SELECT> expanded on Firefox 3, Opera 9.5, IE7

* NB Opera 9.5 behaves differently to the other browsers for <SELECT multiple='multiple'>, in that pressing up and down does not change the actual item selected (space must be pressed for that to occur), so no direct comparison is possible. FWIW, space triggers the change event, up/down does not; which is what I would expect.

My intuition led me to expect that change would get fired on all of those circumstances (because the visual feedback from the browser is that the selected option has changed). The one exception is in Opera 9.5 with <SELECT multiple='multiple'>; when up/down are pressed, but space is not, then the visual feedback from the browser is that the selection hasn't changed, and so I wouldn't expect the change event to fire.

comment:6 Changed 3 years ago by Standart

comment:7 Changed 3 years ago by snover

  • Status changed from new to pending

This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!

comment:8 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed

Automatically closed due to 14 days of inactivity.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.