As stated in https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/ the Modal component must respond to specific keyboard inputs to improve accessibility:
Tab: Moves focus to the next focusable element contained by the Modal. Focus will never go outside of it.
Shift + Tab: Moves focus to the previous focusable element contained by the Modal. Focus will never go outside of it.
Escape: Modal closes and focus goes back to the Element that was focused right before opening it
Also, when opening the modal, focus must be set to the first focusable element that can be found within it.