Unity captures all keyboard inputs by default and does not share keyboard inputs wit the rest of the webpage. This must be disabled to allow blockly blocks with input fields to accept keyboard inputs. However, disabling the keyboard inputs limits the range of capabilities of the game as Unity will no longer be have access to keyboard inputs. Therefore, keyboard inputs must toggle between the Unity canvas and blockly as needed. To do this, add the following code to the start function in a c# script in your unity game.
#if !UNITY_EDITOR && UNITY_WEBGL
// disable WebGLInput.captureAllKeyboardInput so elements in web page can handle keyboard inputs
WebGLInput.captureAllKeyboardInput = false;
#endif