Escape key on modal


I have a modal form and within it there’s datetime picker. Whenever, an esc key was used to cancel the picker, the modal form also closes. Does anyone know if there’s a way to stop the modal from listening to this key? There’s no documentation on the model regarding key bindings.

Many thanks