Skip to content

Commit

Permalink
Change scale search box filter option
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaneH committed Jul 7, 2022
1 parent 456ce5a commit cf04e2e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/Trainer/TrainerDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext } from 'react'
import Select from 'react-select'
import { useContext, useMemo } from 'react'
import Select, { createFilter } from 'react-select'
import styled from 'styled-components'
import {
AvailablePracticeModesType,
Expand Down Expand Up @@ -71,6 +71,14 @@ const TrainerDisplay = () => {
value: AVAILABLE_MODES[s as AvailablePracticeModesType].value,
}))

const fromStartFilter = useMemo(
() =>
createFilter({
matchFrom: 'start',
}),
[]
)

return (
<TrainerDisplayContainer>
<TrainerSection>
Expand All @@ -92,6 +100,7 @@ const TrainerDisplay = () => {
</IconContainer>
</TrainerSectionHeader>
<Select
filterOption={fromStartFilter}
options={scaleOptions}
value={{
label:
Expand Down

0 comments on commit cf04e2e

Please sign in to comment.