# 搜索菜单结果顶部的输出项未正确放置

**URL:** <https://meta.discourse.org/t/search-menu-results-top-outlets-not-correctly-positioned/287870>\
**Category:** Bug\
**Created:** [2023 年12 月 7 日 16:21 UTC](https://meta.discourse.org/t/search-menu-results-top-outlets-not-correctly-positioned/287870 "2023-12-07T16:21:51Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

作者： ![isaac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/isaac/32/235758_2.png) [@isaac](https://meta.discourse.org/u/isaac)\
发布日期： [2023 年12 月 8 日 17:08 UTC](https://meta.discourse.org/t/search-menu-results-top-outlets-not-correctly-positioned/287870/7 "2023-12-08T17:08:19Z")

</div>

> [@benedfit](#):
>
> 我也认为需要将Arkshine识别出的代码更改包含在该PR中，以修复导航栏中的搜索菜单。

[GitHub - discourse/discourse-search-banner](https://github.com/discourse/discourse-search-banner) 现在基于 glimmer 搜索菜单构建，这就是为什么我在那里而不是在 widget 搜索菜单中进行更改。此外，我们将在下个月将 glimmer 搜索菜单推广为所有 discourse 实例的新默认设置，因此为了利用我链接的更改（并领先于他人），我建议在您的网站上启用 glimmer 搜索菜单。这将解决您在导航栏搜索菜单中遇到的任何问题。

您可以通过向 `experimental search menu groups` 站点设置添加一个组来执行此操作。我们目前在 meta 上对此启用了“所有人”。

 ![Screenshot 2023-12-08 at 10.04.15 AM](https://global.discourse-cdn.com/meta/original/4X/b/c/d/bcd95b4bdd36e9b4c242df4bbf8fe0cff9153f56.png)

> [@benedfit](#):
>
> 此外，[discourse/app/assets/javascripts/discourse/app/widgets/search-menu-results.js at e4c373194d95c1393b70f3052ba473ae8faabe8b · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/e4c373194d95c1393b70f3052ba473ae8faabe8b/app/assets/javascripts/discourse/app/widgets/search-menu-results.js#L404-L405) 和 [discourse/app/assets/javascripts/discourse/app/widgets/search-menu-results.js at e4c373194d95c1393b70f3052ba473ae8faabe8b · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/e4c373194d95c1393b70f3052ba473ae8faabe8b/app/assets/javascripts/discourse/app/widgets/search-menu-results.js#L423-L424) 中的包装 div 始终渲染（并且带有空类），因此很难应用 `:last-child` 选择器等。

您链接的代码片段直接与 widget 搜索菜单相关。相同的插件插口在 glimmer 搜索菜单上可用， **并且** 它们的位置正确。如果这对您有帮助，请告诉我 🙂

---

_[View the full topic](https://meta.discourse.org/t/search-menu-results-top-outlets-not-correctly-positioned/287870)._
