Event listener in production on netlify

Hello everyone

I have a calculator react app. I have an event listener added on the document to listen for keyboard events like this:

  useEffect(() => {
    document.addEventListener('keyup', keyboardInputHandler);
    return document.removeEventListener('keyup', keyboardInputHandler);
  }, [])

However, this event listener is working on my localhost, everything is fine. But when I deploy it on netlify it does not work anymore. No errors, no nothing. Simply ignores keyboard inputs.

I have asked the same question on Netlify forum.

Github repo

Live demo deployed on Netlify