I'm trying to make a visual number pad to populate a text input field. I've found a simple JS based one here - https://github.com/samcroft/numeric-keypad and it works perfectly for what I want to achieve when I have it just in an html document. Unfortunately not in Hype.
When I drop the necessary parts in Hype I get the error 'Error in undefined: TypeError: undefined is not an object (evaluating 'confirm.addEventListener')'.
Attached is the project, probably something obvious/simple - my JS coding isn't the best.
The error is a caught exception which the Hype runtime logs to the console. If you want to debug this further, you'll want to setup your developer tools to pause on caught exceptions. This will break at the source of the problem and help you debug. See:
This indicates that the querySelector line above it isn't returning any results for elements where the data-key is "Ok" so you probably need to look into why/how that isn't setup. (Glancing at the code, I'm not sure why you need an "Ok" button for a numpad!)
I found another way - modifying the innerHTML. Works mostly as I need - would love to backspace but for now this will work.
Sharing to help anyone with this requirement in the future. Working Pad.zip (24.6 KB)