# Bug: Kan modal niet sluiten met toetsenbord ("Esc") of door op de modal overlay te klikken

**URL:** https://meta.discourse.org/t/bug-unable-to-close-modal-using-keyboard-esc-or-clicking-modal-overlay/335849
**Category:** Bug
**Created:** [12 november 2024 om 21:12 UTC](https://meta.discourse.org/t/bug-unable-to-close-modal-using-keyboard-esc-or-clicking-modal-overlay/335849 "2024-11-12T21:12:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![king\_laurel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/king_laurel/32/461779_2.png) [@king\_laurel](https://meta.discourse.org/u/king_laurel)
#### Post date: [12 november 2024 om 21:12 UTC](https://meta.discourse.org/t/bug-unable-to-close-modal-using-keyboard-esc-or-clicking-modal-overlay/335849/1 "2024-11-12T21:12:08Z")

</div>

Noticed a bug when replying to a thread:

Reply to a post \> add text \> click Close \> Attempt to escape modal by clicking “Escape” \> Try to escape by clicking the modal overlay \> Then click on the header of the modal and click “escape” and notice focus surround header. Next, scroll on the background using your mouse or up/down arrow. I would expect the modal background to be frozen and not interactive.

My expectation is that when a user clicks the overlay or hits escape, the modal closes and focus returns to the expected element depending on the user’s selection (e.g., keep editing returns to textbox, discard would return you to top of page or create topic, etc.)… right now if you click keep editing focus just 🪄 disappears

![The image shows a screenshot of a web browser window with a white text box at the top and code in the background. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/5/7/c/57c87bb287d4f78ec5f8608f40acd6bdedabce36.gif)

Console has a ton of errors as well.

Thanks!!!

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [18 november 2024 om 20:45 UTC](https://meta.discourse.org/t/bug-unable-to-close-modal-using-keyboard-esc-or-clicking-modal-overlay/335849/11 "2024-11-18T20:45:18Z")

</div>

Good catch, should be fixed by [A11Y: Allow dismissing the discard drafts modal via keyboard by pmusaraj · Pull Request #29802 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/29802)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [22 november 2024 om 15:36 UTC](https://meta.discourse.org/t/bug-unable-to-close-modal-using-keyboard-esc-or-clicking-modal-overlay/335849/14 "2024-11-22T15:36:42Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
