Skip to content

Commit

Permalink
Merge pull request #444 from h3poteto/iss-442
Browse files Browse the repository at this point in the history
refs #442 Implement auto-complete for hashtag
  • Loading branch information
h3poteto authored Feb 23, 2023
2 parents 59b3781 + 8ee5c64 commit 2bc5810
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/compose/AutoCompleteTextarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ const AutoCompleteTextarea: React.ForwardRefRenderFunction<HTMLTextAreaElement,
triggerRef.current.open()
return
}
case '#': {
const res = await props.client.search(token, 'hashtags')
setSuggestList(
res.data.hashtags.map(tag => ({
name: `#${tag.name}`
}))
)
setStartIndex(start)
setMatchWord(token)
triggerRef.current.open()
}
}
}

Expand Down

0 comments on commit 2bc5810

Please sign in to comment.