Fixes issue with modals hiding when the user clicks anywhere.