Opened 12 years ago
Closed 12 years ago
#9495 closed bug (invalid)
$(...).change() on radio not working when using keyboard to change selection in WebKit browsers
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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 (5)
comment:1 Changed 12 years ago by
Component: | unfiled → event |
---|---|
Priority: | undecided → low |
comment:2 Changed 12 years ago by
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 12 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → 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 12 years ago by
Don't no, I havn't reported it because I didn't know which product is affected.
comment:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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!
This works for me in both Chrome and Safari
http://jsfiddle.net/timmywil/wZyRJ/