fix autoselection code for inline modals, should be done on showing them