 set the input value to that character
              valueInput.value = e.key;
              // Position cursor at the end
              valueInput.selectionStart = valueInput.selectionEnd = valueInput.value.length;
            } else if (e.key === 'Backspace' || e.key === 'Delete') {
              // For delete keys, start with empty value
              valueInput.value = '';
            }
          }
        }, 10);
      }
    }
  });
  
  // Filter badge remove click
  document.addEventListener('click',