NicolasCARPi / jquery_jeditable

jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
https://jeditable.elabftw.net
MIT License
1.74k stars 458 forks source link

Add feature to allow pressing ESC to cancel edit #177

Closed silverpresident closed 6 years ago

silverpresident commented 6 years ago

Description

Allow pressing ESC to cancel edit

how to reproduce

Edit a text Press ESC

expected result

Cancels edit

actual result

Nothing happens

Environment

Browser: Chrome OS: Windows 8 jQuery 1.11.1

NicolasCARPi commented 6 years ago

Hello,

This is working with Firefox on GNU+Linux but not with other browsers or operating systems.

I'll try and add this ;)

thezoggy commented 6 years ago
    .bind( 'keydown', function( event ) {
                // cancel on ESC
                if ( event.which === 27 ) {
                    return false;
                }
    })
NicolasCARPi commented 6 years ago

@thezoggy would you mind making a pull request?

thezoggy commented 6 years ago

actually i see the code is already there, just needs slight updating. ill submit in a sec