Prepare menu-close prevention logic for form-controls