Input onKeyPress Function Working Only After Clicking Away

The issue of the dataset not being ready until after the page is fully loaded really shouldn’t be an issue here since you’re performing an action on the dataset after a keypress. The dataset certainly is ready by then.