JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" />

JavaScript

$('input').on('keypress', function (e) {
    if (e.which == 40 || e.which == 41) e.preventDefault();
});