The welcome banner search input loses focus after selecting a result

When you enter a search in the welcome banner, the input field loses focus after selecting a suggested result. This problem also occurs when using the clear button.

Instead, it throws the following error in the console:

(I will PR tomorrow) EDIT: Martin has already a PR ready to fix that.

1 Like

I don’t know if this is related, but there seem to be some inconsistencies when more than one search menu is available. For example using the keyboard shortcut / for search opens and focuses the header search, even when the search banner is rendered. This also happens when the search icon would actually be hidden in the header.

3 Likes

Have you rebuilt recently? I can see a related PR that should fix this behavior: UX: Fix various search shortcut UX issues (#31903) ¡ discourse/discourse@832ed8c ¡ GitHub

2 Likes

Oh, I hadn’t seen that.. this looks like a proper FIX! :grinning_face_with_smiling_eyes:

However, it doesn’t seem to align the behavior fully.. it works with the new search banner in core enabled. Only the search banner gets focus then.

But the banner from the component, now Advanced Search Banner, doesn’t get focus, the search icon in the header gets it.

And if I install Header Search and enable the core banner, both get focus at the same time:

So there seem to be a lot of combinations now and it’s probably a bit tricky to define a clear focus hierarchy?

1 Like

Right, it’s tricky! :sweat_smile:

On a side note, Martin is working on a PR that fixes my issue here and improves a few things. It might help in your context.

3 Likes