Only close modal if escape was hit with keydown; fixes #13929
Merge pull request #14000 from hnrch02/modal-keydown

Only close modal if escape was hit with keydown; fixes #13929