<For each={autoCompleteStore.options}>
{(option, optionIndex) => {
const isHighlighted = optionIndex() === autoCompleteStore.focusedOptionIndex;
return (
<div
data-id={`item${isHighlighted ? ' highlighted-item' : ''}`}
class={classnames(styles.renderedItem, { [styles.highlightedItem]: isHighlighted })}
onMouseEnter={() => onMouseEnterOption(optionIndex())}
onMouseDown={() => selectValue(option)}
role="button"
tabIndex={-1}
>
{option.display}
</div>
);
}}
</For>
<For each={autoCompleteStore.options}>
{(option, optionIndex) => {
const isHighlighted = optionIndex() === autoCompleteStore.focusedOptionIndex;
return (
<div
data-id={`item${isHighlighted ? ' highlighted-item' : ''}`}
class={classnames(styles.renderedItem, { [styles.highlightedItem]: isHighlighted })}
onMouseEnter={() => onMouseEnterOption(optionIndex())}
onMouseDown={() => selectValue(option)}
role="button"
tabIndex={-1}
>
{option.display}
</div>
);
}}
</For>