Bug Tracker

Modify

Ticket #9495 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

$(...).change() on radio not working when using keyboard to change selection in WebKit browsers

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

Description

In WebKit based browsers like Chrome and Safari, the change event isn't fired when using the keyboard to change the selection. Using the mouse works like expected.

Short sample code:

<input type="radio" name="tester" value="1" />
<input type="radio" name="tester" value="2" />
<script type="text/javascript">$('input').change(function() { console.log("fired"); });</script>

Change History

comment:1 Changed 2 years ago by timmywil

  • Priority changed from undecided to low
  • Component changed from unfiled to event

This works for me in both Chrome and Safari

 http://jsfiddle.net/timmywil/wZyRJ/

comment:2 Changed 2 years ago by matthias@…

Using Safari Version 5.0.5 (6533.21.1) on Mac OS X 10.6.7 Build 10J869.

This fiddle works for me when I hit space after selecting the first empty radio button. It doesn't work when hitting the right or left arrow keys.

What I did:

  • Open the link
  • Clicked on "Result" part on white background
  • Hit tab: first radio button becomes selected.
  • Hit space: "fired" gets printed in the console
  • Hit right arrow key: second radio button becomes selected, no "fired" in the console.

A workaround is mentioned here:  http://evilstreak.co.uk/blog/fixing-change-events-on-radios

comment:3 Changed 2 years ago by dmethvin

  • Owner set to matthias@…
  • Status changed from new to pending

Has this been reported as a bug to the Safari/Chrome teams? Seems like they should be able to fix it.

We might be able to do it via a special event handler but then we'd also need to figure out a feature detect to determine whether/when it is needed and based on your description I am not sure that is possible.

comment:4 Changed 2 years ago by anonymous

Don't no, I havn't reported it because I didn't know which product is affected.

comment:5 Changed 2 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

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.