Skip to content

Commit f477798

Browse files
Fixed ##7073 - AutoComplete: context option updates
1 parent 81ac363 commit f477798

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/primevue/src/autocomplete/AutoComplete.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@ export interface AutoCompleteState {
280280
* Defines current options in AutoComplete component.
281281
*/
282282
export interface AutoCompleteContext {
283+
/**
284+
* Current option.
285+
*/
286+
option?: any;
287+
/**
288+
* Index of the current option.
289+
*/
290+
index: number;
283291
/**
284292
* Current selection state of the item as a boolean.
285293
* @defaultValue false

packages/primevue/src/autocomplete/AutoComplete.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ export default {
278278
getPTOptions(option, itemOptions, index, key) {
279279
return this.ptm(key, {
280280
context: {
281+
option,
282+
index,
281283
selected: this.isSelected(option),
282284
focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),
283285
disabled: this.isOptionDisabled(option)

0 commit comments

Comments
 (0)