@dataloop-ai/components 0.20.121 → 0.20.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.121",
3
+ "version": "0.20.122",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -44,7 +44,12 @@
44
44
  :value="topMessage"
45
45
  />
46
46
  </div>
47
- <div class="select-wrapper" tabindex="0" :style="placeholderStyles">
47
+ <div
48
+ class="select-wrapper"
49
+ tabindex="0"
50
+ :style="placeholderStyles"
51
+ @keydown="handleKeyDown"
52
+ >
48
53
  <div ref="select" :class="selectClasses">
49
54
  <div
50
55
  v-if="hasPrepend || searchable"
@@ -1142,6 +1147,24 @@ export default defineComponent({
1142
1147
  },
1143
1148
  handleDeselected(value: any) {
1144
1149
  this.$emit('deselected', value)
1150
+ },
1151
+ handleKeyDown(event: KeyboardEvent): void {
1152
+ if (event.key === 'Enter' && this.isExpanded) {
1153
+ event.preventDefault()
1154
+ event.stopPropagation()
1155
+
1156
+ if (
1157
+ this.highlightedIndex !== -1 &&
1158
+ this.filteredOptions.length > this.highlightedIndex
1159
+ ) {
1160
+ const selectedItem =
1161
+ this.filteredOptions[this.highlightedIndex]
1162
+ if (selectedItem) {
1163
+ this.selectOption(selectedItem)
1164
+ this.closeMenu()
1165
+ }
1166
+ }
1167
+ }
1145
1168
  }
1146
1169
  }
1147
1170
  })