# 환영 배너 검색 입력창에서 결과를 선택한 후 포커스가 사라집니다

**URL:** https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934
**Category:** UX
**Tags:** search, accessibility
**Created:** [4월 1, 2025, 11:52오후 UTC](https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934 "2025-04-01T23:52:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [4월 1, 2025, 11:52오후 UTC](https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934/1 "2025-04-01T23:52:55Z")

</div>

환영 배너에서 검색을 입력하면, 제안된 결과를 선택한 후 입력 필드가 포커스를 잃습니다. 이 문제는 지우기 버튼을 사용할 때도 발생합니다.

대신, 콘솔에 다음과 같은 오류가 발생합니다:

 ![The image shows an error message stack trace indicating a "TypeError: Cannot read properties of null" due to a scenario where a focus search input fails to provide a value. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/7/e/0/7e0bebe31c6cb334be0f5539c577de32bf0cb6ae.png)

(내일 PR을 올리겠습니다) 편집: 마틴이 이미 이를 수정하기 위한 PR을 준비해 두었습니다.

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [4월 2, 2025, 12:00오후 UTC](https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934/2 "2025-04-02T12:00:56Z")

</div>

이것이 관련이 있는지 모르겠지만, 검색 메뉴가 하나 이상 있을 때 일관성이 없는 것 같습니다. 예를 들어, 검색 배너가 렌더링되어 있는 경우에도 검색을 위한 키보드 단축키 `/`를 사용하면 헤더의 검색창이 열리고 포커스가 맞춰집니다. 헤더에서 검색 아이콘이 실제로 숨겨져 있는 경우에도 이 문제가 발생합니다.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [4월 3, 2025, 12:47오전 UTC](https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934/3 "2025-04-03T00:47:12Z")

</div>

> [@manuel](#):
>
> 예를 들어, 검색을 위한 키보드 단축키 `/`를 사용하면 검색 배너가 렌더링되어 있는 경우에도 헤더 검색이 열리고 포커스가 맞춰집니다.

최근에 재빌드(rebuild)를 했나요? 이 동작을 수정해야 하는 관련 PR을 확인할 수 있습니다: [UX: Fix various search shortcut UX issues (#31903) · discourse/discourse@832ed8c · GitHub](https://github.com/discourse/discourse/commit/832ed8ce748982311e5ed654a9110fc608a03bf8)

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [4월 3, 2025, 4:28오후 UTC](https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934/4 "2025-04-03T16:28:00Z")

</div>

오, 그걸 못 봤네.. 이건 제대로 된 수정이네! 😄

하지만 동작이 완전히 일치하는 것 같지는 않아.. 코어에서 새 검색 배너를 활성화하면 동작은 해. 그런데 그때는 검색 배너에만 포커스가 맞춰져.

하지만 컴포넌트의 배너, 즉 이제 고급 검색 배너라고 불리는 그건 포커스가 안 맞아. 헤더의 검색 아이콘에 포커스가 맞춰져.

그리고 헤더 검색을 설치하고 코어 배너를 활성화하면, 두 배너에 동시에 포커스가 맞춰져:

 ![The image shows a webpage with a search bar and a message that says "Welcome back, nolo!" with placesholders "filters by category or tag" and "filters by topic status" beneath it, along with a circular profile picture and a speech bubble on the right side. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/a/6/5/a6573dacd7e5140b8fd8db33dfeb84de85ac6729.png)

그래서 이제 조합이 많이 생겼고, 명확한 포커스 위계를 정의하는 것이 꽤 까다로울 것 같아?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [4월 3, 2025, 4:48오후 UTC](https://meta.discourse.org/t/the-welcome-banner-search-input-loses-focus-after-selecting-a-result/359934/5 "2025-04-03T16:48:11Z")

</div>

맞아요, 좀 까다롭네요! 😅

참고로, Martin이 제 문제를 수정하고 몇 가지 사항을 개선하는 PR을 작업 중입니다. 여러분의 상황에도 도움이 될 수 있을 것 같아요.

> <https://github.com/discourse/discourse/pull/32099>
>
> We now have 3 search UX variations:
> 
> \* Header search
> \* Welcome banner search
> …
> \* Icon search
> 
> And within each of these there is a \`\<SearchMenu /\>\`
> component with an input that needs to be focused based
> on either Ctrl+F or \`/\` shortcuts. This commit makes
> sure that each has a unique ID, and moves the functionality
> of determining the "current" input ID and focusing the
> input to the search service.
> 
> This fixes issues like where pressing Ctrl+F twice on
> the header search would not reveal the regular browser
> search.
