Skip to content

Commit

Permalink
FIX: Remove outlet causing search icon injection elsewhere (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanvidrine authored Mar 6, 2024
1 parent c99eeca commit 0e267b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
8 changes: 8 additions & 0 deletions common/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $max-width: 600px;

.search-menu {
display: flex;
position: relative;

.search-menu-container {
width: 100%;
Expand Down Expand Up @@ -93,6 +94,7 @@ $max-width: 600px;
color: var(--primary-medium);
height: 100%;
padding-right: 0.25em;
position: absolute;
.discourse-no-touch & {
&:hover {
background: transparent;
Expand All @@ -102,6 +104,12 @@ $max-width: 600px;
}
}
}
+ .search-menu-container .search-input {
padding-left: 1.75em;
}
+ .search-menu-container .search-input .search-context {
margin-left: 4px;
}
}
.btn.search-icon.has-search-button-text {
order: 2;
Expand Down
3 changes: 3 additions & 0 deletions javascripts/discourse/components/search-banner.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<PluginOutlet @name="search-banner-below-headline" />
<p>{{html-safe (theme-i18n "search_banner.subhead")}}</p>
<div class="search-menu">
{{#unless this.buttonText}}
<SearchIcon />
{{/unless}}
<SearchMenu />
{{#if this.buttonText}}
<SearchIcon
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions spec/system/viewing_search_banner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@
expect(page).to have_css("#main-outlet .custom-search-banner")
end

it "should hide the search icon when searching within a topic" do
theme.update_setting(:show_on, "all")
theme.save!

topic_page.visit_topic(topic)
expect(topic_page).to have_css(".custom-search-banner")
topic_page.find(".custom-search-banner input#search-term").fill_in(with: "test")
topic_page.find(".custom-search-banner .results li:nth-child(2) a").click

expect(topic_page).to have_css(".custom-search-banner .search-context")
expect(topic_page).to_not have_css(".custom-search-banner .search-icon")
end

it "should display the search icon when searching within a topic when search button text is present" do
theme.update_setting(:show_on, "all")
theme.update_translation("search_banner.search_button_text", "Foo")
Expand Down

0 comments on commit 0e267b6

Please sign in to comment.