Custom HTML Block Search Inputs Lose Focus to Default Search Bar

I solved my problem, here is my updated code if you needed:

root_element.querySelector('#guest-input').addEventListener('keydown', function(event) {
  event.stopPropagation();
  if (event.key === 'Enter') {
    event.preventDefault();
  }
});

root_element.querySelector('#guest-input').addEventListener('input', function() {
  updateTable();
});

root_element.querySelector('#event-input').addEventListener('keydown', function(event) {
  event.stopPropagation();
  if (event.key === 'Enter') {
    event.preventDefault();
  }
});

root_element.querySelector('#event-input').addEventListener('input', function() {
  updateTable();
});

// Rest of my JavaScript code...
3 Likes