Dart sample Enter key not working in FF or Safari #320

sethladd opened this Issue Nov 12, 2012 · 7 comments


None yet

3 participants


No description provided.


Fork isn't working (returns a 404) but in the meantime, here's the fix:

In TodoApp.dart:

    newTodoElement.on.keyPress.add((KeyboardEvent e) {
        if (e.keyCode == 13) {
            var title = newTodoElement.value.trim();

Note, use e.keyCode. There is a bug with e.keyIdentifier: http://code.google.com/p/dart/issues/detail?id=4269


This also works, and is probably better:

void initElementEventListeners() {
    InputElement newTodoElement = query('#new-todo');

    newTodoElement.on.keyPress.add((KeyboardEvent e) {
        if (e.keyCode == KeyCode.ENTER) {
            var title = newTodoElement.value.trim();

Note the use of KeyCode.ENTER


Ok, it works on my Safari and FF. I try to give a look at IE later


I try to make a correct pull request later today...


I'm a bit late but corrected ENTER code in main input & in todo edition. I pushed the compiled js files too.


I believe this is now fixed. Let me know if we've missed anything!

@addyosmani addyosmani closed this Nov 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment