Skip to main content

Bug Tracker

Side navigation

#10494 closed bug (cantfix)

Opened October 14, 2011 01:05PM UTC

Closed October 19, 2011 06:09PM UTC

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:
Blocked by: Blocking:
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"?

Attachments (0)
Change History (2)

Changed October 14, 2011 02:56PM UTC by dmethvin comment:1

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.

Changed October 19, 2011 06:09PM UTC by timmywil comment:2

component: unfiledevent
priority: undecidedlow
resolution: → cantfix
status: newclosed