# Le raccourci clavier "Esc" ne fonctionne pas correctement en mode édition

**URL:** <https://meta.discourse.org/t/esc-keyboard-shortcut-not-working-properly-in-edition-mode/136599>\
**Category:** Bug\
**Tags:** keyboard-shortcuts\
**Created:** [Décembre 20, 2019, 11:05 UTC](https://meta.discourse.org/t/esc-keyboard-shortcut-not-working-properly-in-edition-mode/136599 "2019-12-20T11:05:40Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [Mars 31, 2020, 12:51 UTC](https://meta.discourse.org/t/esc-keyboard-shortcut-not-working-properly-in-edition-mode/136599/11 "2020-03-31T00:51:52Z")

</div>

J’ai appliqué cette correction :

> <https://github.com/discourse/discourse/commit/a34711c23a58c991e44af2ff5e62f618107b244d>
>
> When editing a post we were incorrectly saving a draft prior to user typing
> 
> Thi…s caused a bloat in the amount of drafts saved per user and inconsistency
> around behavior of "escape" button.
> 
> It also lead to lots of warnings about draft conflicts when copying stuff
> between posts.
> 
> The code is improved to use promises more appropriately, however further
> changes are needed to clean up internals so methods consistently return
> promises.
> 
> Too many methods in the controller sometimes return a promise and sometimes
> an object. Long term the methods will become async and all of this will be
> corrected.

Ce fichier est extrêmement délicat @eviltrout… J’ai hâte que nous ayons la prise en charge de `async`, car un grand nombre de méthodes renvoient tantôt une promesse, tantôt un objet, ce qui rend l’analyse du comportement très difficile.

Pour l’instant, j’ai introduit quelques promesses et contournements afin que nous ne sauvegardions pas un brouillon **immédiatement** après avoir cliqué sur le bouton Modifier. Cela rendait également @supermathie fou, car cela compliquait et rendait fastidieux le copiage de texte depuis N réponses vers le message original.

---

_[View the full topic](https://meta.discourse.org/t/esc-keyboard-shortcut-not-working-properly-in-edition-mode/136599)._
