Bug Tracker

Modify

Ticket #8796 (closed bug: duplicate)

Opened 2 years ago

Last modified 18 months ago

Executing .click() on a checkbox performs actions out of order

Reported by: spoonlikesham@… Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.5.1
Keywords: Cc:
Blocking: Blocked by:

Description

A code sample says 1000 words:

    <input type="checkbox" onclick="alert(this.checked?'yes':'no')" id="test" />

Pretty simply unchecked checkbox. Clicking on it will check it and then alert "Yes"

However, doing the same thing with jQuery:

    $('#test').click()

Excutes in the opposite it order. It will alert "No", and then check the checkbox.

Suspect the FIRST action should be to change the checked status, followed by onclick() and other Click events.

Change History

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to event

jQuery cannot be accountable for the event firing order in the presence inline event handlers

comment:2 Changed 18 months ago by dmethvin

  • Status changed from closed to reopened
  • Resolution invalid deleted

comment:3 Changed 18 months ago by dmethvin

  • Status changed from reopened to closed
  • Resolution set to duplicate

comment:4 Changed 18 months ago by dmethvin

Duplicate of #3827.

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.