Bug Tracker

Modify

Ticket #10494 (closed bug: cantfix)

Opened 20 months ago

Last modified 20 months ago

Radio button checked state inconsistent with e.preventDefault()

Reported by: halcyon1234 Owned by:
Priority: low Milestone: None
Component: event Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

 http://jsfiddle.net/ABGPA/4/

Click on a Radio Button that is part of a group. No radio button in the group is clicked yet. That radio button's click handler contains e.preventDefault().

Expected: That radio button will not become checked after any click, leaving the group "empty".

Result: The clicked radiobutton becomes checked. All further clicks work as expected.

Other note: I don't know if this is expected, but $(this).is(":checked") returns True, even though e.preventDefault() keeps it from retaining its check. I would have expected it never get checked in the first place, rather than become checked, then become unchecked. Could this "set/unset" check be the reason why the first radio button becomes checked-- because the browser doesn't support "clear checks from radio button group"?

Change History

comment:1 Changed 20 months ago by dmethvin

Originally asked here:  http://stackoverflow.com/questions/5982930/radio-preventdefault-not-working-on-chrome-and-ff-3-6-but-does-work-on-ie9-and

Here's a simpler test case:

 http://jsfiddle.net/dmethvin/ABGPA/6/

But it also fails without jQuery:

 http://jsfiddle.net/dmethvin/ABGPA/7/

This looks like a browser bug to me, one that we cannot easily fix since the browser is just ignoring preventDefault. Both Chrome and Firefox are on a fast release cycle, so if it is truly a bug it should be possible to report this to them and get it fixed.

The "other note" is a dup of #3827 but the main issue is not.

comment:2 Changed 20 months ago by timmywil

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

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.