How can I disable a Key Down action when a modal is open?

I’m making good use of the Key Down action for easy navigation through records. I’m using the arrow-left and arrow-right keys. But, I’ve just noticed that these still work when a modal is open so I was testing an edit form, pressed the right arrow and the record changed!

How can I set the keys to only respond on the main page and stop responding when a modal is open? Where is the best place to put the key down actions as I currently have them on the App component itself.

Community Page
Last updated: