highlight first suggestion by default

This commit is contained in:
Sanchit Agarwal 2024-07-19 11:26:04 +05:30 committed by GitHub
parent de3e844baa
commit e21990a804
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,11 +15,13 @@ const FormulaSearch: React.FC<React.HTMLAttributes<HTMLDivElement>> = (
id="luckysheet-formula-search-c"
className="luckysheet-formula-search-c"
>
{context.functionCandidates.map((v) => (
{context.functionCandidates.map((v, index) => (
<div
key={v.n}
data-func={v.n}
className="luckysheet-formula-search-item"
className={`luckysheet-formula-search-item ${
index === 0 ? "luckysheet-formula-search-item-active" : ""
}`}
>
<div className="luckysheet-formula-search-func">{v.n}</div>
<div className="luckysheet-formula-search-detail">{v.d}</div>