You would have to more the eSearch widget or your layerToggleButton widget to a different widget group. What i mean by this is if you are using the default foldable theme and have the eSearch in an on screen widget placeholder and the layertoggle button(s) also in an onscreen widget place holder, then only one widget in the onscreen widget place holder can be open at a time so the toggle would close the eSearch. But if you had the eSearch or the Toggle button in the header controller and the other in an onscreen widget place holder slot then you problem is solved.