Skip to content

Commit

Permalink
fix: improve dropdown input field performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Oct 4, 2024
1 parent eb37369 commit 8cfaa9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webui/src/Components/DropdownInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { DropdownChoice, DropdownChoiceId } from '@companion-module/base'
import { CFormLabel } from '@coreui/react'
import classNames from 'classnames'
import React, { createContext, useContext, useMemo, useEffect, useCallback, memo } from 'react'
import Select from 'react-select'
import Select, { createFilter } from 'react-select'
import CreatableSelect, { CreatableProps } from 'react-select/creatable'
import { InlineHelp } from './InlineHelp.js'
import { WindowedMenuList } from 'react-windowed-select'

export const MenuPortalContext = createContext<HTMLElement | null>(null)

Expand Down Expand Up @@ -181,6 +182,8 @@ export const DropdownInputField = memo(function DropdownInputField<Multi extends
options: options,
value: isMultiple ? currentValue : currentValue[0],
onChange: onChange,
filterOption: createFilter({ ignoreAccents: false }),
components: { MenuList: WindowedMenuList },
}

const isValidNewOption = useCallback(
Expand Down

0 comments on commit 8cfaa9c

Please sign in to comment.