Skip to content

Commit

Permalink
Fix search
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Apr 21, 2024
1 parent 09f620c commit 64d0808
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ColorSchemeGroup } from '../../types';

const schemes = [
{
id: 'presetAndSupersetColors',
id: 'supersetAndPresetColors',
label: 'Preset + Superset',
group: ColorSchemeGroup.Featured,
colors: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import { Tooltip } from 'src/components/Tooltip';
import Icons from 'src/components/Icons';
import { OptionData } from 'src/components/Select/types';
import { StyledSelect } from 'src/components/Select/styles';
import { renderSelectOptions } from 'src/components/Select/utils';
import {
handleFilterOptionHelper,
renderSelectOptions,
} from 'src/components/Select/utils';
import ColorSchemeLabel from './ColorSchemeLabel';

export interface ColorSchemes {
Expand Down Expand Up @@ -228,6 +231,14 @@ const ColorSchemeControl = ({
value={currentScheme}
getPopupContainer={triggerNode => triggerNode.parentNode}
showSearch
filterOption={(search, option) =>
handleFilterOptionHelper(
search,
option as OptionData,
['label', 'value'],
true,
)
}
>
{renderSelectOptions(options)}
</StyledSelect>
Expand Down

0 comments on commit 64d0808

Please sign in to comment.