Fixed ##7073 - AutoComplete: context option updates

pull/7007/merge
tugcekucukoglu 2025-01-14 10:07:43 +03:00
parent 81ac3639c1
commit f4777982ce
2 changed files with 10 additions and 0 deletions

View File

@ -280,6 +280,14 @@ export interface AutoCompleteState {
* Defines current options in AutoComplete component.
*/
export interface AutoCompleteContext {
/**
* Current option.
*/
option?: any;
/**
* Index of the current option.
*/
index: number;
/**
* Current selection state of the item as a boolean.
* @defaultValue false

View File

@ -278,6 +278,8 @@ export default {
getPTOptions(option, itemOptions, index, key) {
return this.ptm(key, {
context: {
option,
index,
selected: this.isSelected(option),
focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),
disabled: this.isOptionDisabled(option)