Skip to content

Commit 4d39672

Browse files
committed
fix(autocomplete): typeahead and prevent submit on enter
1 parent 87e37d5 commit 4d39672

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dev/pages/inputs/AutoComplete.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const schema
1414
id: 'basic',
1515
name: 'basic',
1616
complete: search,
17+
dropdown: true,
1718
label: 'Basic AutoComplete - Use [h]ello',
1819
},
1920
{
@@ -22,7 +23,6 @@ const schema
2223
name: 'chips',
2324
multiple: true,
2425
typeahead: false,
25-
complete: search,
2626
label: 'Chips Replacement',
2727
},
2828
]

src/components/PrimeAutoComplete.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ const styleClass = computed(() => (props.context?.state.validationVisible && !pr
5151
:suggestions="suggestions"
5252
:dropdown="context?.dropdown ?? false"
5353
:multiple="context?.multiple ?? false"
54-
:typeahead="context?.typeahead ?? true"
54+
:typeahead="context?.attrs.typeahead ?? true"
5555
:pt="context?.pt"
5656
:pt-options="context?.ptOptions"
5757
:unstyled="context?.unstyled ?? false"
58+
@keydown.enter.prevent
5859
@complete="search"
5960
@change="handleInput"
6061
@blur="handleBlur"

0 commit comments

Comments
 (0)