@dataloop-ai/components 0.20.261-new-input.0 → 0.20.261-new-input.1
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
|
@@ -1321,6 +1321,16 @@ export default defineComponent({
|
|
|
1321
1321
|
const inputRef = this.$refs.input as HTMLInputElement
|
|
1322
1322
|
inputRef.focus()
|
|
1323
1323
|
},
|
|
1324
|
+
openSuggestionMenuOnFocus(): void {
|
|
1325
|
+
if (!this.openSuggestionsOnFocus || !this.suggestItems?.length) {
|
|
1326
|
+
return
|
|
1327
|
+
}
|
|
1328
|
+
this.$nextTick(() => {
|
|
1329
|
+
if (this.focused) {
|
|
1330
|
+
this.isMenuOpen = true
|
|
1331
|
+
}
|
|
1332
|
+
})
|
|
1333
|
+
},
|
|
1324
1334
|
onFocus(e: InputEvent): void {
|
|
1325
1335
|
this.handleValueTrim()
|
|
1326
1336
|
const el = e.target as HTMLElement
|
|
@@ -1328,9 +1338,7 @@ export default defineComponent({
|
|
|
1328
1338
|
el.scroll(el.scrollWidth, 0)
|
|
1329
1339
|
}
|
|
1330
1340
|
this.focused = true
|
|
1331
|
-
|
|
1332
|
-
this.isMenuOpen = true
|
|
1333
|
-
}
|
|
1341
|
+
this.openSuggestionMenuOnFocus()
|
|
1334
1342
|
this.$emit('focus', e)
|
|
1335
1343
|
},
|
|
1336
1344
|
blur(): void {
|
|
@@ -1356,9 +1364,7 @@ export default defineComponent({
|
|
|
1356
1364
|
},
|
|
1357
1365
|
onNativeFocus(e: FocusEvent): void {
|
|
1358
1366
|
this.focused = true
|
|
1359
|
-
|
|
1360
|
-
this.isMenuOpen = true
|
|
1361
|
-
}
|
|
1367
|
+
this.openSuggestionMenuOnFocus()
|
|
1362
1368
|
this.$emit('focus', e)
|
|
1363
1369
|
},
|
|
1364
1370
|
onNativeBlur(e: FocusEvent): void {
|