Skip to content

Commit 69a5da7

Browse files
authored
FIX: headerSearch not always appearing when welcomeBanner is removed (#32804)
To reproduce... Site settings must be enabled: `Enable welcome banner` `Search experience` = `Search field in site header` 1. Visit /categories, refresh, do not scroll 2. Click a category 3. Observe no search banner or header search ![image](https://github.com/user-attachments/assets/3e9da6cd-aa8b-4141-8e98-5419e54ef685) The fix resets `welcomeBannerSearchInViewport` when the search banner component is destroyed. ![image](https://github.com/user-attachments/assets/63d799e7-4b1b-4e55-bb1b-cc2555a12a50)
1 parent da6b82f commit 69a5da7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/assets/javascripts/discourse/app/components/welcome-banner.gjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export default class WelcomeBanner extends Component {
2727

2828
observer.observe(element);
2929

30-
return () => observer.disconnect();
30+
return () => {
31+
observer.disconnect();
32+
this.search.welcomeBannerSearchInViewport = false;
33+
};
3134
});
3235

3336
handleKeyboardShortcut = modifier(() => {

0 commit comments

Comments
 (0)