• Sam Saccone's avatar
    Fix spec compliance for Marionette. · ca2b6620
    Sam Saccone authored
    What:
    
    In issue #789 @ColinEberhardt pointed out that many of the examples do
    not respect the rule that when a user hits the esc key on an input that
    the input should be cleared and the input state should be left.
    
    Upon investigation I found the Marionette example to have never followed
    this directive.
    
    How:
    
    Due the how the escape key works and the keypress event binding from
    jQuery one must use the keyup event to register for the escape key
    keycode.
    
    Once I intercept the event I instruct the input area to simply rerender.
    This has the desired effect in that it clears the transient input state
    and also due to it rendering new childnodes clears the focus from the
    user.
    ca2b6620
TodoMVC.Layout.js 2.31 KB