Accessibility features mentioned by @claydiffrient

Modal is now closed on an ESC keypress.
Default TAB key behaviour is prevented while the modal is open.
Fixed TAB functionality to switch between modal buttons when alert is active.
Added conditions for handling ENTER / SPACE keys while alert is active.
[+] Added missing preventDefault call