With the control panel refactoring, the auto_complete widget was set on a different target, which caused issues with the search bar: the event handlers for the search bar were triggered before the handlers for the auto_complete widget. With this commit, we make sure they are handled in the proper order. Also, a small piece of code that was supposed to check the position of the cursor was lost. closes odoo/odoo#30795