This will be more of a problem for editing, since those aren't stored (even on-page) after your cancel the edit.
This is related to T101178: Press ESC to cancel a message.
Checked in betalabs.
This is worth cherry-picking to production.
This is in OOjs UI, though, and I don't know if cherry-picks are usually done there for such cases. It requires a build step.