# Esc закрывает и панель поиска, и всплывающее окно чата

**URL:** https://meta.discourse.org/t/esc-closes-both-search-panel-and-chat-popup/292068
**Category:** Bug
**Tags:** search, chat
**Created:** [18.Январь.2024 11:57:36 UTC](https://meta.discourse.org/t/esc-closes-both-search-panel-and-chat-popup/292068 "2024-01-18T11:57:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [18.Январь.2024 11:57:36 UTC](https://meta.discourse.org/t/esc-closes-both-search-panel-and-chat-popup/292068/1 "2024-01-18T11:57:36Z")

</div>

Если открыто всплывающее окно чата, а затем открыта панель поиска и нажата клавиша Esc, закрываются оба элемента, хотя ожидается, что закроется только панель поиска, так как именно на ней находится фокус/курсор.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [19.Январь.2024 13:14:16 UTC](https://meta.discourse.org/t/esc-closes-both-search-panel-and-chat-popup/292068/2 "2024-01-19T13:14:16Z")

</div>

@j.jaffeux По-моему, это вполне обоснованная обратная связь. Что ты думаешь?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [22.Январь.2024 14:19:45 UTC](https://meta.discourse.org/t/esc-closes-both-search-panel-and-chat-popup/292068/3 "2024-01-22T14:19:45Z")

</div>

👍

Должно быть сделано здесь:

> <https://github.com/discourse/discourse/pull/25364>
>
> The keydown event fires as soon as the key is pressed down. This is often prefer…red for actions that need to occur immediately, like stopping a process, closing a modal window, or canceling an ongoing operation. The immediacy of keydown makes it more responsive, as the user doesn't have to fully press and release the key.
> 
> Moreover, it allows us to not close chat on escape when the search menu is open.

Спасибо.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [22.Январь.2024 14:19:51 UTC](https://meta.discourse.org/t/esc-closes-both-search-panel-and-chat-popup/292068/4 "2024-01-22T14:19:51Z")

</div>


