Input onKeyPress Function Working Only After Clicking Away

Edited my response above. I have resolved the issue by working around the two bugs I encountered and saving the value from the input directly to the dataset.