Search: Cannot read properties of null (reading 'focus')

I wanted to implement my own SearchPanel by using the ‘createPanel’ options of the search extension and I faced a small error :“Cannot read properties of null (reading ‘focus’)”.

Actually, my Panel doesn’t implement a “[name=search]” queryable element so when using the ‘openSearchPanel’ command, I faced the previous error.

The issue has been easily fixed on my side but I wanted to report it in order to improve the extension API. Easy solution would be to check that the ‘searchInput’ is defined before focusing/selecting it in ‘openSearchPanel’.

Thanks again @marijn for you amazing work on CodeMirror.

This patch should help here (and also make it easier to focus some specific field by default).