Automatic search input focus only works when panel already exists

When opening a custom search panel, the search input (marked with a main-field="true" attribute) only receives focus when the search panel already exists. When the search panel does not already exist, focus() is not called.

Demo: Try CodeMirror

I think this may have come about because the default search panel has a call to the search input’s select() method on mount, which masks the problem.

It occurs to me now that it may be that the idea is that you focus the search input via the mount() method. If so, it’s not clear from the docs and seems a little inconsistent.

Yes, that is how the default search panel works. Though it would also make sense to use the same focusing mechanism there, changing that at this point doesn’t seem worth it.