Header search plugin

Hi, I really like this plugin.
But when I update discourse to [v1.6.0.beta2 ] yesterday, it does not showed up.

Thanks for your help.

Hey @iminai008, this is because the Discourse header logic has changed significantly in the latest releases. I will be updating this plugin soon. I am updating Quick Messages first, then I will get to this one.

3 Likes

Wonderful news, thank you.

Hey @iminai008 Iā€™ve just committed an update for this plugin so that itā€™s fully compatible with the new header. I basically had to re-write it, so let me know if there are any issues. Cheers, Angus.

https://github.com/angusmcleod/discourse-header-search/commit/c7131fe7fc3ae52d543fb714b6ed43ee9eb1ba21

3 Likes

Thank you very much, it works. :beer:

1 Like

Hi @angus, Iā€™m getting the search box on our mobile version, is there any way to disable it?

2 Likes

Fixed :slight_smile:

https://github.com/angusmcleod/discourse-header-search/commit/8799a8592201eb663a7b7c684e83dd2a81e8da51

2 Likes

You need to update to the latest commit on the plugin by rebuilding your docker container.

One big concern I have with this plugin is that it will be terribly broken on all iDevices, if you ever focus on a INPUT on a fixed panel on iOS it will scroll the whole page either to the top or the bottom. There are no workarounds short of taking every single element on the page out of standard layout.

Iā€™ve previously precluded the search bar widget from being attached in mobileView which includes iPhones.

Just testing it now on my iPad it seems to work fine.

Looking around the interwebs, I see there is an issue with .focus() on iOS, however Iā€™m not using that method.

Could you point me in the right direction to understand / test the issue? Cheers.

It works fine, if you are at the top of the topic, try scrolling down a bit.

4 Likes

Hello!

I have this plugin and am running it on a mac in chrome. The header is rearranged in a weird way when resizing the window and making it small, picture below:

I really like this search bar, but for some reason the original search button is also still visible. Do you know if there is any smart way to hide it?

Hey, thanks for using this plugin and for giving feedback. Iā€™ll be fixing this tomorrow I hope, so stay tunedā€¦

3 Likes

Both of these are fixed now.

4 Likes

When you scroll down on a topic the header search is hidden in favor of the ā€˜extra infoā€™ and the normal search icon re-appears.

The transition between the two states was indeed not amazing on iPad, as it wasnā€™t handling the scrollTop that occurs when you focus on the normal search input while scrolled on a topic. Iā€™ve added some better show / hide handling for that.

https://github.com/angusmcleod/discourse-header-search/commit/32bfe9acbda663253a96637d8943c00a4dadbdbb

2 Likes

When I am using header search plugin. It is showing error in console like this:

Error: Could not find module discourse/views/application imported from discourse/plugins/discourse-header-search/discourse/initializers/header-search-edits.
Pls help me to solve this error.

@pankaj Thanks for the issue report.

Looks like the application view has been removed.

Luckily, I donā€™t actually need it!

This is fixed.

https://github.com/angusmcleod/discourse-header-search/commit/d53d1416dd85c161c221c4e851b985e41afdbac3

1 Like

Hi @angus, I updated the Discourse version to the latest, and all of a sudden, the header search box is gone. I checked the plugin, itā€™s configured properly. I even tried rebuilding the docker container once again. What might be the issue for this?

Forum Link: http://forum.hellboundbloggers.com

P.S. I really love the header search box. :ā€™)

Hey @angus, weā€™re seeing the header box sporadically appear and then disappear. It will always show while in the admin pages though. Is that something you have seen before? We have a custom header over the forum, but that shouldnā€™t really impact the functionality of the header search bar should it? The forum is a new setup, so I donā€™t know if it wouldā€™ve worked with an earlier discourse version.

@pradeepkumar @David_Scharf Hey chaps, sorry for the slow reply to you both.

Iā€™ve updated the show / hide logic of the search input. Itā€™s now:

let headerWidth = this.$('.d-header .contents').width(),
    panelWidth = this.$('.d-header .panel').width(),
    titleWidth = this.$('.d-header .title a').width() + 560, // 560 is the width of the search input
    showHeaderSearch = headerWidth > (panelWidth + titleWidth + 50);

Hopefully that fixes the issue for your site headers.

https://github.com/angusmcleod/discourse-header-search/commit/1b3b48266c386ad89abd2881b570fb4cf35a59d0

1 Like