<commit_before><style lang="sass">
  .simple-list-input {
    align-items: center;
    display: inline-flex;
    flex: 1 0 auto;
    height: 32px;
    margin-bottom: 5px;
    min-width: 100px;
    position: relative;

    .simple-list-add {
      border-bottom: none;
      flex: 1 0 auto;
      width: auto;
    }
  }
</style>

<template>
  <div class="simple-list-input" :class="classes">
    <input
      type="text"
      class="ui-textbox__input simple-list-add"
      ref="input"
      v-model.trim="val"
      @input="onChange"
      @keydown.enter.prevent="onEnter"
      @keydown.tab="addItem"
      @keyup.comma="ignoreComma ? null : addItem()"
      @keydown.delete="focusLastItem"
      @keydown.left="focusLastItem"
      @keydown.right="focusFirstItem"
      @keydown.down="autocompleteFocus(false)"
      @keydown.up.prevent="autocompleteFocus(true)"
      @focus="onFocus"
      @blur="onBlur"
      v-conditional-focus="focusOnInput" />
    <autocomplete
      v-if="showAutocomplete"
      :args="autocomplete"<commit_msg>Add keypress prop to simple-list-input (#1395)<commit_after><style lang="sass">
  .simple-list-input {
    align-items: center;
    display: inline-flex;
    flex: 1 0 auto;
    height: 32px;
    margin-bottom: 5px;
    min-width: 100px;
    position: relative;

    .simple-list-add {
      border-bottom: none;
      flex: 1 0 auto;
      width: auto;
    }
  }
</style>

<template>
  <div class="simple-list-input" :class="classes">
    <input
      type="text"
      class="ui-textbox__input simple-list-add"
      ref="input"
      v-model.trim="val"
      @input="onChange"
      @keydown.enter.prevent="onEnter"
      @keydown.tab="addItem"
      @keyup.comma="ignoreComma ? null : addItem()"
      @keydown.delete="focusLastItem"
      @keydown.left="focusLastItem"
      @keydown.right="focusFirstItem"
      @keydown.down="autocompleteFocus(false)"
      @keydown.up.prevent="autocompleteFocus(true)"
      @keypress="(event) => $emit('keypress', event)"
      @focus="onFocus"
      @blur="onBlur"
      v-conditional-focus="focusOnInput" />
    <autocomplete
      v-if="showAutocomplete"
      :args="autocomplete"
{'fraction_non_alphanumeric': 0.15182279649284725, 'fraction_numerical': 0.011075219197046609, 'mean_word_length': 2.8439716312056738, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1526483', 'n_tokens_mistral': 777, 'n_tokens_neox': 734, 'n_words': 119}