My mistake, I was looking at the wrong debug window.
The issue is related to the modal container. If you notice, the close (X) button is immediately focused when the search is finished. If I remove that close X button, then the keyboard does not close. I suspect there is something in the modal script that auto-focuses the close button, causing the keyboard close. It is not coming from the search plugin unfortunately, and I couldn’t find which script it is. It could be a mutation observer code, those are extremely hard to debug.