refs #16672. Fixes the behavior of the close button on iOS using an evolution of a fix proposal by Frank Fortson (CLA).