Skip to content

Commit

Permalink
Make mention filtering case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbrodin committed Nov 20, 2019
1 parent a86c835 commit 5d7a4b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.6.2 2019-11-20
### Fixes
- Makes mention filtering case insensitive.

## 0.6.1 2019-11-20
### Fixes
Fixes the 0.6.0 release.
Expand Down
7 changes: 6 additions & 1 deletion src/Mention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export const Mention: React.FC<MentionProps> = ({
const [forceHide, setForceHide] = React.useState<boolean>(false);

const filtered = data
.filter(item => fuzzySearch(withoutPrefix, `${item.value}${item.label}`))
.filter(item =>
fuzzySearch(
withoutPrefix.toLowerCase(),
`${item.value}${item.label}`.toLowerCase()
)
)
.slice(0, maxItems);

React.useEffect(() => {
Expand Down

0 comments on commit 5d7a4b3

Please sign in to comment.